Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-Id: <6.0.1.1.0.20031221073651.01f06d28@imap.myrealbox.com> X-Sender: tprince AT imap DOT myrealbox DOT com Date: Sun, 21 Dec 2003 07:39:06 -0800 To: , From: Tim Prince Subject: Re: Java hello world link error In-Reply-To: <000001c3c777$8b6084e0$6664a8c0@cipheroptics.com> References: <000001c3c777$8b6084e0$6664a8c0 AT cipheroptics DOT com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-IsSubscribed: yes At 08:04 PM 12/20/2003, mauro zallocco wrote: >Folks, > >I installed gcc-java on Windows XP, and am attempting to compile: > >class Test { > public static void main(String argv[]) { > System.out.println("Hello World"); > } >} > >with the following command: >g++ Test.java > >This produces a gazillion link errors, a sample follows: >/cygdrive/c/DOCUME~1/mzallocc/LOCALS~1/Temp/ccywNFar.o(.text+0x2d):Test.java >: undefined reference to `__Jv_InitClass' >/cygdrive/c/DOCUME~1/mzallocc/LOCALS~1/Temp/ccywNFar.o(.text+0x37):Test.java >: undefined reference to `java::lang::System::out' >/cygdrive/c/DOCUME~1/mzallocc/LOCALS~1/Temp/ccywNFar.o(.text+0x5f):Test.java >: undefined reference to `java::lang::Object::Object[in-charge]()' >/cygdrive/c/DOCUME~1/mzallocc/LOCALS~1/Temp/ccywNFar.o(.text+0xc8):Test.java >: undefined reference to `__Jv_RegisterClass' > > Why not start out by linking it as a java program, with gcj, rather than as C++ ? Tim Prince -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/