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: gcj and JAMA


Andreas Balser writes:
 > > You need to tell us a bit more.  What did you do to compile the
 > > JAMA-Matrix jarfile?
 > 
 > I downloaded the source (should I try the jarfile?), and compiled it
 > as listed in the "P.S.":
 > 
 > /tmp $ tar xvzf Jama-1.0.1.tar.gz
 > [...]
 > :/tmp/Jama $ gcj -c *.java
 > :/tmp/Jama/util $ gcj -c Maths.java 
 > :/tmp/Jama $ ar r libMatrix.a `find . -name \*.o`

Version skew.

I think your problem is due to the fact that the .class files and the
.java files in the directory don't correspond to the same version.
You are compiling against the .class files, and linking against the
.java files.  

Delete the .class files, and:

 $ export CLASSPATH=.:/tmp/
 $ find . -name '*.class' | xargs rm
 $ gcj -c *.java -g
 $ (cd util/ && gcj -c Maths.java -g)
 $ ar r libMatrix.a `find . -name \*.o`
 $ gcj TestMatrix.java -o TestMatrix --main=TestMatrix -L /tmp/Jama -lMatrix -g
 $ ./TestMatrix 

Alternatively, compiling the class files and linking against the
.class files would also work.

The new gcj ABI will avoid this problem.

Andrew.


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