gcj TCPClient.java Error

J

Johnny

I'm attempting to compile "TCPClient.java" taken from the book,
"Computer Networking" by James Kurose and Keith Ross, but I'm running
into an error... I'm compiling using "gcj" under cygwin. Here's the
error I get:

$ gcj TCPClient.java
/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../libcygwin.a(libcmain.o)::
undefined r
eference to `_WinMain@16'
collect2: ld returned 1 exit status

I did a Google on "undefined reference to `_WinMain@16'" and got this:
http://www.google.com/search?hl=en&q=undefined+reference+to+`_WinMain@16'

Many of the references at that link are from 2003. I checked my system
clock and it says 2006. Can anyone help me out? Thanks!
 
J

Johnny

Johnny said:
I'm attempting to compile "TCPClient.java" taken from the book,
"Computer Networking" by James Kurose and Keith Ross, but I'm running
into an error... I'm compiling using "gcj" under cygwin. Here's the
error I get:

$ gcj TCPClient.java
/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../libcygwin.a(libcmain.o)::
undefined r
eference to `_WinMain@16'
collect2: ld returned 1 exit status

I did a Google on "undefined reference to `_WinMain@16'" and got this:
http://www.google.com/search?hl=en&q=undefined+reference+to+`_WinMain@16'

Many of the references at that link are from 2003. I checked my system
clock and it says 2006. Can anyone help me out? Thanks!

I found my problem...
Reference http://www.linuxjournal.com/article/4860

I needed to do the following:
$ gcj -c -g -O TCPClient.java
$ gcj --main=TCPClient -o TCPClient TCPClient.o
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,189
Latest member
CryptoTaxSoftware

Latest Threads

Top