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


If I compile HelloWorld against libgcj DLL, and without
-findirect-dispatch - then try to run it...

gcj -o HelloWorld.exe --main=HelloWorld --classpath=. -L. -ltest HelloWorld.java

HelloWorld.exe
Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorld
   at java.lang.Class.initializeClass(gcj.dll)
Caused by: java.lang.NullPointerException
   <<No stacktrace available>>

If I, in the other hand use -findirect-dispatch, the output would be
"Hello, World".

Also, if I try to use a Test DLL, as soon as I try to use the class it
would throw an exception when I run it:

gcj -shared -o Test.dll -Wl,--out-implib,libtest.a
gcj -o HelloWorld.exe --main=HelloWorld --classpath=. -L. -ltest
HelloWorld.java -findirect-dispatch

HelloWorld.exe
Exception in thread "main" java.lang.NoClassDefFoundError: Test
   at HelloWorld.<init>(HelloWorld.exe)

Daniel


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