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?

Recommended Answers

All 5 Replies

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

though you may also want Glu32.lib

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!

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.

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.