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: internal compiler error: can't find class$


Thomas Léauté writes:
 > 
 > Le Sep 2, 2004, à 11:45 AM, Andrew Haley a écrit :
 > 
 > > There is a ton of different things that might cause this.
 > >
 > > Please let us know what commands you used to compile the files, and
 > > exactly what versions of the tools you used.
 > 
 > OK; I have just re-implemented completely in java the class "coutUI"  
 > (now called "simpleUI"), and now the error message comes up during the  
 > linking phase:
 > 
 > > /usr/bin/ld: Undefined symbols:
 > > simpleUI::class$
 > > simpleUI::simpleUI()
 > 
 > You can see that it does not find the constructor either.
 > I did the following:
 > 
 > > gcj -C -classpath ./or124.jar:.  *.java

gcj -c -classpath ./or124.jar:. *.java

 > > gcjh  simpleUI
 > > g++-3.5 -c main.cpp
 > > g++-3.5 -o test main.o -lgcj

You need to add the .o files created by "gcj -c"

 > (or124.jar is a package used by the BlueNode class)

So you should compile that as well:

gcj or124.jar -o or124.o

and link at the end with or124.o.

It's quite easy really: compile *everything* with -c, whether C++ or
Java, and then link the reulting .o files together.

 > g++-3.5 --version returns:
 > 
 > > g++-3.5 (GCC) 3.5.0 20040613 (experimental)
 > 
 > This is a version I got from Gaurav Khanna, the author of the following  
 > web page: http://hpc.sourceforge.net/ . The web page says: " recently  
 > compiled using source code from the GNU CVS servers, tree-ssa  
 > lno-branch".
 > 
 > Note that I also get the following error:
 > 
 > > /usr/bin/ld: warning multiple definitions of symbol _sqrt
 > > /usr/local/lib/gcc/powerpc-apple-darwin6.8/3.5.0/../../../ 
 > > libgcj.a(w_sqrt.o) definition of _sqrt in section (__TEXT,__text)
 > > /usr/lib/libSystem.dylib(sqrt970.o) definition of _sqrt

I don't know why the linker is complaining about that.  It finds a
definition of _sqrt in libgcj.a, so it shouldn't care that there is
also one in libSystem.dylib.  I vaguely remember this to be some sort
of bug in Darwin's linker.

Andrew.


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