Jesper Juul wrote:
> I am having problems getting a DLL to work with JavaCompiler 0.7 and=20
> 0.8, and I wonder if somebody has a suggestion for how to get it to wor=
k.
>=20
> I hope someone has an idea of whether this is a known gcj problem, or=20
> I am missing some parameter to make it work.
>=20
> **** The problem: *****
>=20
> The actual program I am working on is too big to post here, but I=20
> have made a very simple test case with two classes, Test and TestB:
>=20
>=20
> public class Test
> {
>=20
> public static void main(String args[])
> {
> TestB t=3Dnew TestB();
> t.hi();
> }
> }
>=20
> *
>=20
> public class TestB
> {
>=20
> public void hi()
> {
> System.out.println("Yes!");
> }
> }
>=20
> *
> I compile them like this
> gcj -shared -I. TestB.java -o TestB.dll
> gcj -I. Test.java TestB.dll --main=3DTest -o Test.exe
>=20
> Compilation gives this info/warning:
> Info: resolving TestB::class$ by linking to __imp___ZN5TestB6class=
$E (auto
> import)
>=20
> If I run the Test.exe program, I get this error (JavaCompiler 0.7)
> Exception in thread "main" java.lang.NoClassDefFoundError: TestB
> at 0x562408(Unknown Source)
>=20
> For JavaCompiler 0.8:
> Exception in thread "main" java.lang.NoClassDefFoundError: TestB
> at java.lang.Class.initializeClass(Test.exe)
> Caused by: java.lang.NullPointerException
> <<No stacktrace available>>
Shared libraries are not supported in gcj 4.x for Windows.
It's a long standing problem, you can see many messages about it in the g=
cj list and also some info at http://www.thisiscool.com/gcc_mingw.htm
--=20
Ren=E9 Berber
|