[Mono-list] strange mono initialization problem

Paolo Molaro lupus@ximian.com
Fri, 23 Aug 2002 12:41:23 +0200

On 08/23/02 John Sohn wrote:
> I would also prefer to use the shared library however there are
> functions in the Mono JIT project that conflict with actual Win32
> functions. I used the debugger to step through the dynamically linked
> libmono.so code and it was calling WINE's RtlEnterCriticalSection (and
> other Rtl... functions) instead of Mono's. If the function names were
> not exactly the same I believe I could dynamically link the mono
> runtime. If I take the same project/makefile and link to libmono.a
> instead of libmono.so the project behaves properly. Using the static
> library ensures the correct functions are getting called. Perhaps
> there's a gcc/link setting I'm not aware of that would fix this problem.

Yes, see the other mail about the linker version script.

> #include <gc/gc.h>
> #include <windows.h>
> #include <stdio.h>
> int PASCAL WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
>                     LPSTR lpszCmdLine, int nCmdShow)
> {
>         void* test = NULL;
>         printf("start\n");
>         test = GC_malloc(1);
>         printf("end\n");
> }

How do I compile/link such app? Just adding -lwine complains about the
missing main function (man, I'm so glad I never had to work with the
windows API!).
Once we can compile the app, we'll try to pin down the issue.


lupus@debian.org                                     debian/rules
lupus@ximian.com                             Monkeys do it better