954,498 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

OpenGL in VC++ 2005

I had been studying OpenGL in DevCPP all the time. Using DevCPP you link OpenGL library files libopengl32.a and libglu32.a adjusting project options. But I dont know how to do this in VC++.
Can you help me what files to link and how to link in Visual Studio 2005 for OpenGL?

AhmedHan
Junior Poster in Training
71 posts since Apr 2005
Reputation Points: 13
Solved Threads: 1
 

Install the Win32 platform SDK, and link in OpenGl32.lib
I don't think you need to do anything else.

jwenting
duckman
Team Colleague
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
 

though you may also want Glu32.lib

jwenting
duckman
Team Colleague
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
 

It is well explained in MSDN :

To add .lib files as linker input in the development environment

Open the project's Property Pages dialog box. For details, see -Setting Visual C++ Project Properties. -Click the Linker folder. -Click the Input property page. -Modify the Additional Dependencies property. To programmatically add .lib files as linker input

Thanks everybody!

AhmedHan
Junior Poster in Training
71 posts since Apr 2005
Reputation Points: 13
Solved Threads: 1
 

And also,

#pragma comment(lib, "opengl32.lib");
#pragma comment(lib, "glu32.lib");


may be added at the beginning of the program code as an alternative.

AhmedHan
Junior Poster in Training
71 posts since Apr 2005
Reputation Points: 13
Solved Threads: 1
 

yes, but that makes your sources compiler dependent, something you should if possible try to avoid ;)
Better let the linker config handle such details.

jwenting
duckman
Team Colleague
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You