PDA

View Full Version : Trouble compiling first openGL code in VS2005



Canadian0469
05-08-2008, 01:57 PM
Hi everyone,

I just started taking a Computer Graphics course and I just installed visual studio 2005 on my laptop which is running Vista. I posted some of my profs sample code into my source code window (C++ code) and it won't compile. I get 11 errors. It isn't recognizing the glut libraries.

I downloaded the glut32.dll, glut32.lib, and glut.h files and put them in the appropriate directories but VS doesn't seem to recognize them because I'm getting the following error message:
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\glut32.lib : warning LNK4003: invalid library format; library ignored.

Any ideas?

Thanks,
Canadian0469

Zengar
05-08-2008, 02:17 PM
Well, it is exactly the way it is: the c interface files you downloaded aren't compatible with your compiler. You may

a) look for a right file
b) compile the glut yourself
c) build a library yourself (it is a dummy anyway, as it links to a dll)

I always considered the whole C library stuff extremely confusing. The compiler and linker interface belong together (or at least, the difference should be hidden from the programmer).

Canadian0469
05-08-2008, 02:24 PM
I just had to add opengl32.lib glu32.lib glut32.lib to the additional depencies for the linker in the VS 2005 options menu.

Zengar
05-08-2008, 02:34 PM
strange... why was it giving the compatibility error?