Spring Heart wrote:
> I use JNC 1.1.1 on windows with gcc-122233-lin (~280Megs folder)
> downloaded from JNC website several days ago. My OS is WinXP SP2 and I
> had a problem while compiling my simple Helloworld code to run on
> Linux as below.
>
> class HelloWorld
> {
> public static void main(String args[])
> {
> System.out.println("Hello World!");
> }
> }
So it's HelloWorld.java or HelloWorld.class, right?
> The Compiler returns this error message.
>
> creating "Hello.so" for Linux
Why "Hello.so"? .so is a shared lib, you're creating a binary. But this
has nothing to do with your problem.
> - main compilation step
> [C:\NativeCompiler\gcc-122233-lin\gcc-122233-lin\bin\gcj
> --main=HeloWorld
What now? HeloWorld.java? This has to be HelloWorld.
> -fjni
> -Djava.library.path=lib
> -Dsun.java2d.fontpath=
> -Djava.home=.
> -Djava.awt.graphicsenv=sun.awt.X11GraphicsEnvironment
You can exclude AWT/Swing, you don't need it for that simple
application. But again, this has nothing to do with your problem.
> -Llibs/lin
> -Ilibs/lin/gui/gui.jar
> -oC:\NativeCompiler\JavaNativeCompiler-1.1.1\Hello.so
> -s
> -O2
> -IC:\NativeCompiler @C:\DOCUME~1\user\LOCALS~1\Temp\JNCTempbvr71c.out\SourceListbvr71d.list]
> C:\DOCUME~1\user\LOCALS~1\Temp/ccY9caaa.o: In function
> `main':cc0Ecaaa.i:(.text+0x29): undefined reference to `HeloWorld::class$$'
Here again, you're compiling HelloWorld but specify HeloWorld as main class.
Hope that helps...
Marco
|