Mingw32 gcj & CNI

Guironnet Fabien fg.java@free.fr
Fri Aug 27 21:28:00 GMT 2004


Hello,

I've build 2 cross-compilers for win32 (gcc 3.4.2 (20040709) et 3.5.0 
(20040822)).
When I try to compile GTK applications with these compilers, all work 
fine, but when I try the code sample from 
http://gcc.gnu.org/onlinedocs/gcj/Invocation.html I've problems...

If I try :
mingw32-g++ test.cc -o test.exe -lgcj

/usr/share/gcc3.5.0-cross/lib/gcc/mingw32/3.5.0/../../../../mingw32/lib/libgcj.a(win32-threads.o)(.text+0x359): 
In function `_Z15_Jv_ThreadStartPN4java4lang6ThreadEP12_Jv_Thread_tPFvS2_E':
/mnt/share/tmp/gcc-cross/work3.5.0-20040822/gcc.tmp/gcc.src/libjava/win32-threads.cc:382: 
undefined reference to `_GC_CreateThread@24'
/usr/share/gcc3.5.0-cross/lib/gcc/mingw32/3.5.0/../../../../mingw32/lib/libgcj.a(win32.o)(.text+0x20d): 
In function `_ZN15WSAEventWrapper4initEim':
/mnt/share/tmp/gcc-cross/work3.5.0-20040822/gcc.tmp/gcc.src/libjava/win32.cc:164: 
undefined reference to `_WSACreateEvent@0'
/usr/share/gcc3.5.0-cross/lib/gcc/mingw32/3.5.0/../../../../mingw32/lib/libgcj.a(win32.o)(.text+0x225):/mnt/share/tmp/gcc-cross/work3.5.0-20040822/gcc.tmp/gcc.src/libjava/win32.cc:166: 
undefined reference to `_WSAEventSelect@12'
/usr/share/gcc3.5.0-cross/lib/gcc/mingw32/3.5.0/../../../../mingw32/lib/libgcj.a(win32.o)(.text+0x281): 
In function `_ZN15WSAEventWrapperD2Ev':
/mnt/share/tmp/gcc-cross/work3.5.0-20040822/gcc.tmp/gcc.src/libjava/win32.cc:183: 
undefined reference to `_WSACloseEvent@4'
/usr/share/gcc3.5.0-cross/lib/gcc/mingw32/3.5.0/../../../../mingw32/lib/libgcj.a(win32.o)(.text+0x299):/mnt/share/tmp/gcc-cross/work3.5.0-20040822/gcc.tmp/gcc.src/libjava/win32.cc:173: 
undefined reference to `_WSAEventSelect@12'
/usr/share/gcc3.5.0-cross/lib/gcc/mingw32/3.5.0/../../../../mingw32/lib/libgcj.a(win32.o)(.text+0x2b9):/mnt/share/tmp/gcc-cross/work3.5.0-20040822/gcc.tmp/gcc.src/libjava/win32.cc:180: 
undefined reference to `_ioctlsocket@12'
/usr/share/gcc3.5.0-cross/lib/gcc/mingw32/3.5.0/../../../../mingw32/lib/libgcj.a(win32.o)(.text+0x2d5): 
In function `
(...)



If I try :
mingw32-g++ -c test.cc -I/usr/share/gcc3.5.0-cross/include/
mingw32-gcj -o text.exe test.o

the compilation works fine but the last command gives :
/usr/share/gcc3.5.0-cross/lib/gcc/mingw32/3.5.0/../../../../mingw32/lib/libgcj.a(win32-threads.o)(.text+0x359): 
In function `_Z15_Jv_ThreadStartPN4java4lang6ThreadEP12_Jv_Thread_tPFvS2_E':
/mnt/share/tmp/gcc-cross/work3.5.0-20040822/gcc.tmp/gcc.src/libjava/win32-threads.cc:382: 
undefined reference to `_GC_CreateThread@24'
/usr/share/gcc3.5.0-cross/lib/gcc/mingw32/3.5.0/../../../../mingw32/lib/libgcj.a(alloc.o)(.text+0x2df):alloc.c: 
undefined reference to `_GC_stop_world'
/usr/share/gcc3.5.0-cross/lib/gcc/mingw32/3.5.0/../../../../mingw32/lib/libgcj.a(alloc.o)(.text+0x359):alloc.c: 
undefined reference to `_GC_start_world'
/usr/share/gcc3.5.0-cross/lib/gcc/mingw32/3.5.0/../../../../mingw32/lib/libgcj.a(alloc.o)(.text+0x3e6):alloc.c: 
undefined reference to `_GC_start_world'
/usr/share/gcc3.5.0-cross/lib/gcc/mingw32/3.5.0/../../../../mingw32/lib/libgcj.a(misc.o)(.text+0xb78):misc.c: 
undefined reference to `_GC_thr_init'
/usr/share/gcc3.5.0-cross/lib/gcc/mingw32/3.5.0/../../../../mingw32/lib/libgcj.a(os_dep.o)(.text+0x291):os_dep.c: 
undefined reference to `_GC_push_all_stacks'
/usr/share/gcc3.5.0-cross/lib/gcc/mingw32/3.5.0/../../../../mingw32/lib/libgcj.a(mark_rts.o)(.text+0x650):mark_rts.c: 
undefined reference to `_GC_push_thread_structures'
/usr/share/gcc3.5.0-cross/lib/gcc/mingw32/3.5.0/../../../../mingw32/lib/libgcj.a(mark_rts.o)(.text+0x3d2):mark_rts.c: 
undefined reference to `_GC_push_thread_structures'
/usr/share/gcc3.5.0-cross/lib/gcc/mingw32/3.5.0/../../../../mingw32/lib/libgcj.a(dyn_load.o)(.text+0x34):dyn_load.c: 
undefined reference to `_GC_get_next_stack'
/usr/share/gcc3.5.0-cross/lib/gcc/mingw32/3.5.0/../../../../mingw32/lib/libgcj.a(dyn_load.o)(.text+0x193):dyn_load.c: 
undefined reference to `_GC_get_next_stack'
/usr/share/gcc3.5.0-cross/lib/gcc/mingw32/3.5.0/../../../../mingw32/lib/libgcj.a(dyn_load.o)(.text+0x1d4):dyn_load.c: 
undefined reference to `_GC_get_next_stack'
collect2: ld returned 1 exit status


Have I missed something in my commands? or my cross-compilers aren't 
well configured?

Thanks for your help,

    Fabien




More information about the Java mailing list