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+%60_WinMain@16%27
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!
Johnny - 03 Jul 2006 15:43 GMT
> I'm attempting to compile "TCPClient.java" taken from the book,
> "Computer Networking" by James Kurose and Keith Ross, but I'm running
[quoted text clipped - 12 lines]
> 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