hello world,
I have been using gcj (
http://gcc.gnu.org/java/) as well as javac to compile the programs I have been writing in "Begining Java 2: SDK 1.4" and have had little problem until now. I was working on Ch.5 "Testing the Geometry Package" (p.219). When runing gcj I get the following message:
$ gcj -I. -o Trypackage --main=TryPackage TryPackage.java
/tmp/ccuUHHTo.o(.text+0x1c3): In function `TryPackage::main(JArray<java::lang::String*>*)':
: undefined reference to `Geometry::Point::class$'
/tmp/ccuUHHTo.o(.text+0x218): In function `TryPackage::main(JArray<java::lang::String*>*)':
: undefined reference to `Geometry::Point::class$'
/tmp/ccuUHHTo.o(.text+0x2cf): In function `TryPackage::main(JArray<java::lang::String*>*)':
: undefined reference to `Geometry::Point::Point[in-charge](double, double)'
/tmp/ccuUHHTo.o(.text+0x301): In function `TryPackage::main(JArray<java::lang::String*>*)':
: undefined reference to `Geometry::Line::class$'
/tmp/ccuUHHTo.o(.text+0x367): In function `TryPackage::main(JArray<java::lang::String*>*)':
: undefined reference to `Geometry::Line::class$'
/tmp/ccuUHHTo.o(.text+0x3f2): In function `TryPackage::main(JArray<java::lang::String*>*)':
: undefined reference to `Geometry::Line::Line[in-charge](Geometry::Point*, Geometry::Point*)'
collect2: ld returned 1 exit status
The Geometry package is in ./Geometry/ and when I use javac it compiles and runs fine. When I use gcj to goto byte code it runs fine (using java or gij). Only when I try to go from a class to a native executible (or direct from source to an executable) to I get the above error messages. If anyone knows of a good reference for gcj, I would be happy to know about it.
Thank you for your time and consideration, Kyle