[Mono-list] Managed C++ assemblies and Mono
Sergey Chaban
serge@wildwestsoftware.com
Wed, 8 Jan 2003 21:22:16 +0200
> As long as it is only the initialization code, the few routines that are
> used can be faked, so that should be no problem.
I think the problem here is finding managed entry point.
Say, C++ compiler generates _mainCRTStartup() entry, this is embedded
x86 code, how would you find managed entry without interpreting mainCRTStartup?
You can't rely on the naming, because even though managed entry for MC++ would
be called "main", it's just a convention - some .NET obfuscators already replace
this with something else. Well, unless I'm missing something :-)
BTW, to produce pure IL from C++ code the following options needed for the linker
(assuming that -clr option is already used for the compiler):
$link -nodefaultlib -entry:main mscoree.lib
But anyway original question was about using MC++ to interact with C++ libs compiled
to _native_ code, if I understood the post correctly. I think in such case a C interface and
P/Invoke would be a much better choice.
Sergey