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: Problem compiling DLL


> 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


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