Linking problem

Alexandre Petit-Bianco apbianco@cygnus.com
Tue Aug 28 19:45:00 GMT 2001


Colin Walters writes:

> Maybe it could just be added to the FAQ for now?  I was having the
> same problem.

So, how about this?

./A

2001-08-28  Alexandre Petit-Bianco  <apbianco@redhat.com
            Colin Walters <walters@verbum.org>

	* faq.html (4.1.a): New entry.

Index: faq.html
===================================================================
RCS file: /cvs/gcc/wwwdocs/htdocs/java/faq.html,v
retrieving revision 1.43
diff -u -p -r1.43 faq.html
--- faq.html    2001/07/11 18:43:38     1.43
+++ faq.html    2001/08/29 02:44:23
@@ -49,6 +49,7 @@
           <ol>
             <li><a href="#4_1">Why do I get <tt>undefined reference to `main'</tt> 
               errors?</a> 
+            <li><a href="#4_1_a">Why do I get "undefined reference to a symbol ending in `class$'?</a> 
             <li><a href="#4_2">Can GCJ only handle source code? </a> 
             <li><a href="#4_3">"gcj -C" Doesnt seem to work like javac/jikes. 
               Whats going on? </a> 
@@ -482,6 +483,22 @@ $ ../configure [...]
           option to indicate the class that has the desired <tt>main</tt> method. 
           This is because every Java class can have a <tt>main</tt> method, thus 
           you have to tell gcj which one to use.</dd>
+        <dt> </dt>
+        <hr>
+      </dl>
+      <dl> 
+        <dt> 
+          <h3><a name="4_1_a">4.1.a Why do I get "undefined reference to a symbol ending in `class$'?</a></h3>
+        </dt>
+      </dl>
+      <p> 
+      <dl> 
+        <dd>This problem is usually caused by passing an incorrect
+           class name to the <tt>--main</tt> argument.  The class name needs
+           to be fully qualified with the package name, and names
+           should be separated by `<tt>.</tt>'. Note that this is a
+           <A HREF=" http://gcc.gnu.org/ml/java-prs/2001-q1/msg00072.html" ;>
+           known</A> problem.
         <dt> </dt>
         <hr>
       </dl>



More information about the Java mailing list