[Mono-dev] windows build of a mono embedded app [part 2]
jonathan.shore at gmail.com
Mon Dec 19 12:49:47 EST 2011
So I got around some compilation issues (thanks Robert) in building an embedded mono application on windows. I resolved my build issues by explicitly using MinGW g++ as opposed to cygwin's. Although cygwin g++ appears to be some variant of MinGW, was not able to get it to work. Moving to MinGW was easy enough.
The application presents itself as a DLL which is then loaded into R. The ultimate linkage looks like:
c:/MinGW/bin/g++.exe -shared -s -static-libgcc -m32 CSObject.o RDebug.o RUtils.o RWrap.o ToC.o ToCLR.o ToR.o -o rDotNet.dll -Wl,-headerpad_max_install_names -Lc:/Dev/hf/src/Libraries/CApi/bin/Debug -Lc:/Dev/hf/src/Libraries/CApi/lib/win32 -lCApi -lmono-2.0 -lm "-Lc:/Program Files/R/R-2.14.0/bin/i386" -lR
This successfully creates a dll. The problem is that when trying to load this dll into R, complains that cannot find libmono-2.0. As I do most of my work on OSX and Linux, have not yet determined what governs the DLL search path. Also, libmono-2.0.dll.a does not appear to be a traditional dll, so suspect this is a loading mechanism specific to MinGW compiled DLLs.
In any case, I tried another approach of linking against libmono-2.0.a, rather than the shared-lib. This resulted in a list of unmatched symbols from the windows core API and socket libraries.
- what windows libraries and/or options do I need to add to the MinGW g++ link line to resolve dependencies for the static library
- if static not advisable, what can I do to avoid the problem where libmono -2.0 is not found?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Mono-devel-list