This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Linking with .LIB files

David W Palmer[] 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 Peters -
-- Saga University Dept. of Information Science

For help on using this list, send a message to
"" with one line of text: "help".

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]