This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GCJ with native structs



The "gcj" command doesn't link the C++ runtime libraries by default, which you'll need to do a non-java "new". Try adding -lsupc++.

Regards

Bryce.


Yeah, I thought of this before but that led to problems also.


Heres what I have:
gcj --main=Test Test.java natTest.o -lsupc++

Gives this message:
c:/gcc-3.4/bin/../lib/gcc/i686-pc-mingw32/3.4/../../../../i686-pc-mingw32/lib/li
bgcj.a(win32.o)(.data+0x0):win32.cc: multiple definition of `_CRT_MT'
c:/gcc-3.4/bin/../lib/gcc/i686-pc-mingw32/3.4/../../../../i686-pc-mingw32/lib/li
bmingw32.a(crtst.o)(.data+0x0):crtst.c: first defined here
c:/gcc-3.4/bin/../lib/gcc/i686-pc-mingw32/3.4/../../../../i686-pc-mingw32/lib/li
bsupc++.a(vterminate.o)(.text+0x6d):vterminate.cc: undefined reference to `__cxa
_demangle'


It looks like libgcj has CRT_MT already defined which conflicts with mingw32 lib. Using libstdc++ instead of libsupc++ gets rid of the last error message listed above.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]