undefined reference to when using gcj

V

vlenin66

Hi,

My little helloword uses package:
package javaapplication2;
I can compile and execute it with javac/java:
en@gepem:~/NetBeansProjects/JavaApplication2/src$ javac
javaapplication2/Main.java
en@gepem:~/NetBeansProjects/JavaApplication2/src$ java
javaapplication2.Main
Hello Hattyú

However, when I try to compile it using gcj, I get this:
~/NetBeansProjects/JavaApplication2/src$ gcj --main=Main
javaapplication2/Main.java -o Main
/tmp/ccqiWhM6.o: In function `main':
cc2ARovz.i:(.text+0x1d): undefined reference to `Main::class$$'
collect2: ld returned 1 exit status

I use /usr/bin/gcj.4.1 on linux.

What do I miss?
Thanks!
 
S

Syren Baran

vlenin66 said:
Hi,

However, when I try to compile it using gcj, I get this:
~/NetBeansProjects/JavaApplication2/src$ gcj --main=Main
javaapplication2/Main.java -o Main
/tmp/ccqiWhM6.o: In function `main':
cc2ARovz.i:(.text+0x1d): undefined reference to `Main::class$$'
collect2: ld returned 1 exit status
How about "gcj --main=javaapplication2.Main javaapplication2/Main.java
-o Main"?
You need to fully specify the class, including package.
 
V

vlenin66

vlenin66 schrieb:> Hi,


How about "gcj --main=javaapplication2.Main javaapplication2/Main.java
-o Main"?
You need to fully specify the class, including package.

Thanks, That works! Perfect solution.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,816
Latest member
nipsseyhussle

Latest Threads

Top