[Mono-dev] R <-> mono: linking to libmono.a on windows (cygwin) problems

Jonathan Shore jonathan.shore at gmail.com
Fri Dec 16 19:30:08 EST 2011


Should I install a separate ming-gcc and try building in the cmd shell or
is there something else likely to be wrong?   the -mno-cygwin option is
recognized, but I get the same issue.   Here is the -v option which shows
the final linking:

     [exec]  /usr/lib/gcc/i686-pc-mingw32/3.4.4/collect2.exe -Bdynamic -o
rDotNet.dll
/usr/lib/gcc/i686-pc-mingw32/3.4.4/../../../../i686-pc-mingw32/lib/crt2.o
-Lc:/cygwin/home/jonathan.shore/Dev/hf/src/Libraries/CApi/lib/win32
-Lc:/cygwin/home/jonathan.shore/Dev/hf/src/Libraries/CApi/bin/Debug
-Lc:/Program Files/R/R-2.14.0/bin/i386/
-L/usr/lib/gcc/i686-pc-mingw32/3.4.4 -L/usr/lib/gcc/i686-pc-mingw32/3.4.4
-L/usr/lib/gcc/i686-pc-mingw32/3.4.4/../../../../i686-pc-mingw32/lib
-L/usr/lib/gcc/i686-pc-mingw32/3.4.4/../../.. -L
/usr/i686-pc-mingw32/sys-root/mingw/lib
c:/cygwin/home/jonathan.shore/Dev/hf/src/Libraries/CApi/lib/win32/libmono-2.0.dll.a
-lR -lmono-2.0 /tmp/ccILXCG3.o /tmp/ccJEF9fo.o /tmp/ccanTwx7.o
/tmp/ccplAvT1.o /tmp/ccz8AVe8.o /tmp/ccfiDw2B.o /tmp/ccTcsUKn.o
/tmp/cc9UqTZx.o /tmp/ccqfDboR.o /tmp/ccn1IMSt.o /tmp/ccWYgkXj.o -lstdc++
-lmingw32 -lgcc -lmoldname -lmingwex -lmsvcrt -lmingw32 -luser32 -lkernel32
-ladvapi32 -lshell32 -lmingw32 -lgcc -lmoldname -lmingwex -lmsvcrt
     [exec] /tmp/ccfiDw2B.o:ToCLR.cpp:(.text+0x91): undefined reference to
`_mono_string_new'
     [exec] /tmp/ccfiDw2B.o:ToCLR.cpp:(.text+0x10e): undefined reference to
`_mono_get_double_class'
     [exec] /tmp/ccfiDw2B.o:ToCLR.cpp:(.text+0x130): undefined reference to
`_mono_value_box'
     [exec] /tmp/ccfiDw2B.o:ToCLR.cpp:(.text+0x1ca): undefined reference to
`_mono_get_int32_class'
     [exec] /tmp/ccfiDw2B.o:ToCLR.cpp:(.text+0x1ec): undefined reference to
`_mono_value_box'
     [exec] /tmp/ccfiDw2B.o:ToCLR.cpp:(.text+0x20c): undefined reference to
`_mono_get_int32_class'
     [exec] /tmp/ccfiDw2B.o:ToCLR.cpp:(.text+0x22e): undefined reference to
`_mono_array_new'
     [exec] /tmp/ccfiDw2B.o:ToCLR.cpp:(.text+0x25a): undefined reference to
`_mono_array_addr_with_size'
     [exec] /tmp/ccfiDw2B.o:ToCLR.cpp:(.text+0x2a0): undefined reference to
`_mono_get_string_class'
     ...


On Fri, Dec 16, 2011 at 3:30 PM, Robert Jordan <robertj at gmx.net> wrote:

> Hi,
>
> Linking with libmono.a is not supported under Cygwin.
> Moreover, linking a cygwin app with libmono.la (libmono.dll.a
> -> mono.dll) would disable Mono's SIGSEGV handler. This means
> that NullReferenceExceptions would crash your app.
>
> > A compilation like:
> >
> > g++ -o rDotNet.dll -I<mono include dir>  -L<R libs>  -L<mono libs>
> *.cpp -lR
> > -lmono-2.0
>
> Try g++ -mno-cywin ...
>
> It should work if the R libs were compiled with -mno-cywin as well.
>
> Robert
>
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>



-- 
Jonathan Shore
http://tr8dr.wordpress.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20111216/4d868812/attachment.html 


More information about the Mono-devel-list mailing list