Wrox Programmer Forums
|
BOOK: Beginning Java 2
This is the forum to discuss the Wrox book Beginning Java 2, SDK 1.4 Edition by Ivor Horton; ISBN: 9780764543654
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Java 2 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 23rd, 2004, 06:14 PM
Registered User
 
Join Date: Aug 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Using gcj

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

 
Old August 28th, 2004, 05:18 AM
Authorized User
 
Join Date: Sep 2003
Posts: 98
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Use javac!










Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.