delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/08/03/14:18:49

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: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT sourceware DOT cygnus DOT com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
List-Help: <mailto:cygwin-help AT sourceware DOT cygnus DOT com>,
<http://sourceware.cygnus.com/ml/#faqs>
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 <steve AT finagle DOT org>
X-Mailer: Mozilla 4.51 [en] (Win98; I)
X-Accept-Language: en
MIME-Version: 1.0
To: Cygnus/Windows Mailing List <cygwin AT sourceware DOT cygnus DOT com>
Subject: Mingw/Link: Can't find "WinMain" in library.

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019