This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
Java hello world link error
- From: "mauro zallocco" <mzallocc at nc dot rr dot com>
- To: <cygwin at cygwin dot com>
- Date: Sat, 20 Dec 2003 23:04:33 -0500
- Subject: Java hello world link error
- Reply-to: <mzallocc at nc dot rr dot com>
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'
Poking around I managed the following:
$ gcc -I /usr/include/java/util/jar Test.java
/usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/../../../libcygwin.a(libcmain.o)(.text
+0x7
c): undefined reference to `_WinMain@16'
collect2: ld returned 1 exit status
What do I need to include to resolve _WinMain@16 ?
Mauro
/Mauro
--
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/