incorrect? link order for mingw gcj
aking@dreammechanics.com
aking@dreammechanics.com
Thu Apr 4 07:14:00 GMT 2002
There seems to be a library link order problem with the current cvs 3.1
branch of the mingw32 cross compiler. A simple hello world compiles
and runs fine, however, this simple java program fails to compile:
public class GCJTest
{
public static void main( String[] args )
{
try
{
Thread.sleep( 2000 );
}
catch( Exception e ) {}
}
}
the error is:
aking@nanostorm:~/gcj-test$ i686-pc-mingw32-gcj --main=GCJTest -o /tmp/gcjtest.exe GCJTest.java
/home/aking/mingw-gcc/lib/gcc-lib/i686-pc-mingw32/3.1/../../../../i686-pc-mingw32/lib/libgcj.a(exception.o): In function `abort':
/home/aking/compile/mingw-gcj/bin/i686-pc-mingw32/libjava/../../../gcc/libjava/exception.cc:27: multiple definition of `abort'
/home/aking/mingw-gcc/lib/gcc-lib/i686-pc-mingw32/3.1/../../../../i686-pc-mingw32/lib/libmsvcrt.a(ds00510.o)(.text+0x0): first defined here
However, if I add in the libraries '-lgcj -lmsvcrt', it compiles and runs fine:
aking@nanostorm:~/gcj-test$ i686-pc-mingw32-gcj -lgcj -lmsvcrt --main=GCJTest -o /tmp/gcjtest.exe GCJTest.java
aking@nanostorm:~/gcj-test$
I know almost nothing about how the configure/make build system
works, so I have no idea where to look, sorry. Anyways, I'll continue
on with some other patches I'm working on for mingw32 version.
Adam
More information about the Java
mailing list