Subject: RE: Linking with .LIB files
From: [email-masked] (Colin Peters)

26 Mar 1997 14:15:42 -0800
Approved: [email-masked]
Distribution: cygnus
Message-ID: <01BC39EC.6F6FE340.cygnus.gnu-win32@gbird0>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Original-To: "'David W Palmer'" <[email-masked]>
Original-Cc: "'GNU-Win32'" <[email-masked]>
Original-Sender: [email-masked]

David W Palmer[SMTP:[email-masked]] 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 - [email-masked]
-- 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
"[email-masked]" with one line of text: "help".