Archived

This topic is now archived and is closed to further replies.

blueboycurtis

OpenGL How do you get the OpenGL libs linked when building in Visual C++?

Recommended Posts

Hello, I am not new to programming, I do it for a living -- however, I have been using mostly web technologies, java, and straight C++. I AM new to OpenGL and to Microsoft programming. So I am having some real difficulties. My main concern is this: I have an OpenGL game programming book (written by the CEO and COO of GameDev.net) and it conveniently shows how to write a simple windows WGL program to use OpenGL -- but doesn''t really mention the intricacies involved. (I guess they assume you know Visual C++ well. Oops) Anyways, I need to know about what I wrote in the subject email: when I go to BUILD my .CPP file, it gives me many errors regarding UNRESOLVED EXTERNAL SYMBOL for all of the openGL stuff. I KNOW this has to do with linking (otherwise the stuff compiles fine) ... anyone know how to deal with this? Also, if you know of a good crash course online in general for linking and building Win32 / MFC / etc programs, let me know. Thanks!

Share this post


Link to post
Share on other sites
Go to "Project"->"Settings", and select the "General" category under the "Link" tab. There in the "Object/Library modules" text-box you add "opengl32.lib" and "glu32.lib"

(Sorry if it was to detailed )

Share this post


Link to post
Share on other sites
Ok, umm... thanks for the info with linking libraries for projects in Visual C++. However, I still get a message about "unresolved external symbol _main"

I assume this has to do with my use of
int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)


Is there another standard windows library that I need to link? The books make no mention of this (I have two Visual C++ books and two game programming books and they all conveniently IGNORE library linking!!)

Share this post


Link to post
Share on other sites