#using <mscorlib.dll>
__gc public class Test : public System::Object
{
};
$ cl /clr:noAssembly /LD test.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 13.10.3077 for .NET
Framework
Copyright (C) Microsoft Corporation 1984-2002. All rights reserved.
test.cpp
Microsoft (R) Incremental Linker Version 7.10.3077
Copyright (C) Microsoft Corporation. All rights reserved.
/out:test.dll
/noentry
/noassembly
/dll
/implib:test.lib
test.obj
LIBCMT.lib(crt0.obj) : error LNK2019: unresolved external symbol _main
referenced in function _mainCRTStartup
test.dll : fatal error LNK1120: 1 unresolved externals
and compile this, it will complain about "no entry point".
This is just complaining in C++ speak. :)
--
Girish Bharadwaj
"Peter Ross" <p...@missioncriticalit.com> wrote in message
news:88d535d6.03101...@posting.google.com...
--
Girish Bharadwaj
"Girish Bharadwaj" <girishb.at.mvps.dot.org> wrote in message
news:%23$YeeQlkD...@TK2MSFTNGP12.phx.gbl...
cl /clr:noAssembly /LD empty.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 13.00.9466 for .NET
Framework
Copyright (C) Microsoft Corporation 1984-2001. All rights reserved.
empty.cpp
Microsoft (R) Incremental Linker Version 7.00.9466
Copyright (C) Microsoft Corporation. All rights reserved.
/out:empty.dll
/noentry
/noassembly
/dll
/implib:empty.lib
empty.obj
I guess you are right. This probably is something funky with the .NET 1.1 ..
--
Girish Bharadwaj
"Girish Bharadwaj" <girishb.at.mvps.dot.org> wrote in message
news:%23$YeeQlkD...@TK2MSFTNGP12.phx.gbl...
> I get a link error when I try and create a module of the following
> very simple managed C++ code. I can't imagine a more minimum piece of
> code, so I imagine that this is some sort of compiler bug.
>
> #using <mscorlib.dll>
> __gc public class Test : public System::Object
> {
> };
Not at all. You're running against the changes made to the compiler/linker
to minimize the Loader-Lock problem (a module is esentially a dll, and will
be subject to the same problems).
To get around it, just link with nochkclr.obj:
cl /clr:noAssembly /LD test.cpp nockclr.obj
--
Tomas Restrepo
tom...@mvps.org
Thank you Tomas that did solve the problem.
I had seen some KB articles about the Loader-Lock problem, but
couldn't relate it directly to my problem.
Could you point me to a resource which mentions nochkclr.obj? I am
interested to see why I didn't work it out.
Regards,
Peter
> Thank you Tomas that did solve the problem.
>
> I had seen some KB articles about the Loader-Lock problem, but
> couldn't relate it directly to my problem.
It was a logical conclusion for me, since modules are usually linked into an
assembly, typically a DLL one (and not an EXE).
> Could you point me to a resource which mentions nochkclr.obj? I am
> interested to see why I didn't work it out.
Humm... let me see... I believe the documentation mentions it... See [1] and
[2]
[1]
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/vcerrlinkertoolserrorlnk2019.asp
[2]
http://msdn.microsoft.com/library/en-us/vcmex/html/vcconconvertingmanagedextensionsforcprojectsfrompureintermediatelanguagetomixedmode.asp
--
Tomas Restrepo
tom...@mvps.org