Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm Sender: cygwin-owner AT sourceware DOT cygnus DOT com List-Unsubscribe: List-Archive: List-Help: , Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com Message-ID: <37A731C4.2AFA21B9@finagle.org> Date: Tue, 03 Aug 1999 11:15:32 -0700 From: Steve McAndrewSmith X-Mailer: Mozilla 4.51 [en] (Win98; I) X-Accept-Language: en MIME-Version: 1.0 To: Cygnus/Windows Mailing List Subject: Mingw/Link: Can't find "WinMain" in library. Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit I've been trying to port (from MSVC) a handly little library (tkapp) which eases building Tcl/Tk Win32 apps. It provides a WinMain function, and imports an AppInit() and a string of Tcl application script, and handles the messy init stuff. However, when I try to link my little sample/test program against this library, it's unable to find WinMain (specifically, "WinMain AT 16"). But, if I link directly against the library objects, it works fine. Example: gcc -mwindows -mno-cygwin -o sample sample.o winMain.o tkapp.o -ltcl80 -ltk80 ... works great. BUT ... ar -cr ./libtkapp.a winMain.o tkapp.o gcc -mwindows -L. -mno-cygwin -o sample sample.o -ltkapp -ltcl80 -ltk80 ... and ... gcc -mwindows -mno-cygwin -o sample sample.o ./libtkapp.a -ltcl80 -ltk80 ... both fail with the following message: /CYGNUS/CYGWIN~1/H-I586~1/BIN/../lib/gcc-lib/i586-cygwin32/2.95/../../../../i586-cygwin32/ lib/libmingw32.a(main.o): In function `main': /home/noer/src/b20/comp-tools/devo/winsup/mingw/main.c:89: undefined reference to `WinMain AT 16' collect2: ld returned 1 exit status "objdump --syms libtkapp.a" reports: ... winMain.o: file format pe-i386 SYMBOL TABLE: [ 4](sec 1)(fl 0x00)(ty 20)(scl 2) (nx 1) 0x00000004 _WinMain AT 16 AUX lnno 0 size 0x0 tagndx 0 ... so it would seem that the correct object is included in the library. Gak! Any ideas? I'm stumped, here. -Steve -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com