This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: Problem compiling DLL
- From: "Daniel Adolfsson" <daniel dot adolfsson at gmail dot com>
- To: java at gcc dot gnu dot org
- Date: Thu, 6 Sep 2007 09:13:06 +0200
- Subject: Re: Problem compiling DLL
- References: <000001c7f00a$dcba13f0$cc4861cb@THOMAS>
> I don't know if this is the whole problem but, in win32-land, dll import
> libraries (eg libtest.a) are static stub archives and must follow the
> objects which depend open the library, otherwise the symbols will not be
> resolved (no lazy binding). So try:
>
> gcj -o HelloWorld.exe --main=HelloWorld HelloWorld.java --classpath=.
> -L. -ltest
>
> A second problem that you may encounter with libgcj is that in order for
> it to communicate exceptions across dll/dll or dll/exe boundaries, all
> components must be built with -shared-libgcc.
I think I've tried every possible combination.
Maybe I didn't compile gcj.dll properly? Could that affect anything?
The cross-gcc compiler was configured with:
--enable-languages=c,c++,java
--disable-shared --enable-static
--disable-nls --disable-debug --disable-checking
--enable-threads=win32 --disable-win32-registry --enable-sjlj-exceptions
--enable-libgcj --without-x --disable-java-awt
gcj.dll was compiled using:
find . -name "*.o" | uniq > objectlist
i686-pc-mingw32-gcj -shared `cat objectlist` -o gcj.dll
-Wl,--out-implib,libgcj.a -Wl,--export-all-symbols
-Wl,--enable-runtime-pseudo-reloc -Wl,--allow-multiple-definition
Daniel