Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm Sender: cygwin-owner AT sourceware DOT cygnus DOT com Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com Message-Id: <199905132203.RAA09590@modi.xraylith.wisc.edu> X-Authentication-Warning: modi.xraylith.wisc.edu: localhost.xraylith.wisc.edu [127.0.0.1] didn't use HELO protocol To: "Robert Campbell" cc: cygwin AT sourceware DOT cygnus DOT com Subject: Re: Undefined Reference to WinMain In-reply-to: Your message of "Thu, 13 May 1999 15:57:41 MDT." <000301be9d8b$9f5ba170$1605a8c0 AT lyra DOT geonexuscorp DOT com> Date: Thu, 13 May 1999 17:03:34 -0500 From: Mumit Khan "Robert Campbell" writes: > When compiling up the "V" appgen code, I get the following undefined > references. Does anybody have any ideas. (I'm using egcs-1.1.1) > > /cygnus/CYGWIN~1/H-I586~1/i586-cygwin32/bin/ld: warning: cannot find entry > symbol _WinMainCRTStartup; defaulting to 00401000 > > C:\cygnus\CYGWIN~1\H-I586~1\bin/../lib/gcc-lib/i586-cygwin32/egcs-.91.60/../ > ../../../i586-cygwin32/lib/libcygwin.a(libcmain.o): In function `main': > /home/noer/src/b20/comp-tools/devo/winsup/libcmain.cc:38: > undefined reference to `WinMain AT 16' > Known problem. When linking GUI mode programs, the linker doesn't explicitly look for WinMain, and if WinMain happens to be in an archive (as in the case with V GUI), you lose. Workaround: add "-Wl,-u,_WinMain AT 16" (without the quotes) to GCC flags when you link. For more discussion, see the thread titled 'VGUI v 1.21 problem' in the Cygwin mailing list archives. Regards, Mumit -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com