[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: has anybody managed to embed mzscheme in a visual c++ "multithreaded dll" project?



Quoting Christian Schuhegger:
> i spent the week-end to try to embed mzscheme in a visual c++
> "multithreaded dll" project, but even the simple test program at:
> http://www.cs.rice.edu/CS/PLT/packages/doc/insidemz/node6.htm
> crashes.
> 
> the embedding works fine when i don't use the "multithreaded dll"
> setting, but the "multithreaded" setting.
> 
> i tried already to copy the visual c++ project
> plt\src\worksp\mzscheme,
> set the active project configuration to: "win32 mt dll"
> and replace the main of the main.c with the main in the example given 
> above. this was to make sure that i use the correct preprocessor defines
> and the correct libraries to link to, but the problem still persists.

The "MT DLL" project is one that links to the standard C library as a
DLL, instead of statically linking the C library. In other words, it
uses the /MD flag. (The project is poorly well named! I didn't
understand the issues when I named it, and it's gone for future
releases.)

In /MD mode, an embedding application must call GC_pre_init() to
initialize certain global variables that are used by allocation. In
other modes, the variables are initialized automatically.

So, the problem may be simply that you didn't really want the "MT DLL"
project. I'm not sure how easy it is to build MzScheme v103 as a DLL,
though.

For version 200, MzScheme builds as a DLL by default. So, as soon as
200alpha1 is available, it should work better for you.

Matthew