Mingw/Link: Can't find "WinMain" in library.

Mumit Khan khan@xraylith.wisc.EDU
Tue Aug 31 23:49:00 GMT 1999

Steve McAndrewSmith <steve@finagle.org> writes:
> 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.

This is certainly a bug, and we've talked about this before here with
no resolution as to what the right way to fix it is. I'll submit my
version of the patch soon, and let's see if that works or not.

> However, when I try to link my little sample/test program against this
> library, it's unable to find WinMain (specifically, "WinMain@16").  But,
> if I link directly against the library objects, it works fine.

Here's a temporary workaround:
  $ gcc -Wl,-u,_WinMain@16 [ ... link stuff ... ]

The -u _WinMain@16 tells the linker to "undefine" that symbol so that it'll 
grab it out of the library.


Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

More information about the Cygwin mailing list