delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/03/26/14:15:42

From: colin AT bird DOT fu DOT is DOT saga-u DOT ac DOT jp (Colin Peters)
Subject: RE: Linking with .LIB files
26 Mar 1997 14:15:42 -0800 :
Approved: cygnus DOT gnu-win32 AT cygnus DOT com
Distribution: cygnus
Message-ID: <01BC39EC.6F6FE340.cygnus.gnu-win32@gbird0>
Mime-Version: 1.0
Original-To: "'David W Palmer'" <David_W_Palmer AT ccm DOT jf DOT intel DOT com>
Original-Cc: "'GNU-Win32'" <gnu-win32 AT cygnus DOT com>
Original-Sender: owner-gnu-win32 AT cygnus DOT com

David W Palmer[SMTP:David_W_Palmer AT ccm DOT jf DOT intel DOT com] wrote:
>     So, I have a simple program which uses OpenGL and I link with the 
>     following:
>     
>     link simple.o libuser32.a glu32.lib opengl32.lib libgdi32.a 
>     /subsystem:windows /machine:i386

Although this may be secondary to your concerns, or in fact may be
totally off topic, I notice that libglu32.a and libopengl32.a are
both included with the beta 17.1 distribution. I'm not sure about
the header files, but if you can get your code to compile you should
be able to link it with ld. Of course this doesn't help if what you
really want is DirectX or some other thing that comes with .lib
files you can't convert to .a files.

>      LINK : error LNK2001: unresolved external symbol _WinMainCRTStartup
>      simple.exe : fatal error LNK1120: 1 unresolved externals
>      make: *** [simple.exe] Error 25
>     
>     No .EXE is generated.  And the answer is... what?

This suggests to me that you need to include crt0.o in your link line
explicitly, since that's where _WinMainCRTStartup should be resolved.
Well, actually in the Cygnus sources it's not, but you could just add
a _WinMainCRTStartup entry point which calls the _mainCRTStartup
entry point and it should work OK I think.

Sorry for the rampant uncertainty,

Colin.

-- Colin Peters - colin AT bird DOT fu DOT is DOT saga-u DOT ac DOT jp
-- Saga University Dept. of Information Science
-- http://www.fu.is.saga-u.ac.jp/~colin/index.html
-- http://www.geocities.com/Tokyo/Towers/6162/

-
For help on using this list, send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


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