Basic window framework

Ostsol

New member
My previous framework used MFC, which I kinda liked because it allowed me to use a relatively elegant object-oriented approach. However, it's been giving me some problems when I try to compile it in release mode. Because of this, I'm abandoning MFC, for now, and am going back to a more basic method. Still, I'd like to keep everything as object oriented as possible. However, I've been having problems here as well. I've got tonnes of linker errors declaring a bunch of unresolved external symbols. These happen to be OpenGL functions. I have absolutely no idea what's going on. Here's a zip of my code: members.shaw.ca/dwkjo/OpenGLTest.zip If someone could have a look at it and point me in the right direction, I'd greatly appreciate it. :)
 
Checked out your OpenGLTest.zip file.

You need to link in these libraries: opengl32.lib and glu32.lib
( you need to add them to your project ).
Otherwise it compiles fine for me, under Visual Studios 6.0.

Hope this helps.
 
It's even better to use a pragma for including those libraries automatically.

#pragma comment (lib, "opengl32.lib")
#pragma comment (lib, "glu32.lib")
 
*smacks forehead* Ugh. . . Gee, it's been quite a while since I started an OpenGL project from scratch. Many thanks!
 
Humus said:
It's even better to use a pragma for including those libraries automatically.

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

Ah. . . I can see why: it looks like that's the only way to get it to compile in release mode. . .
 
Not really. You have separate settings for debug and release. If you add those libraries to debug mode only you'll still get link errors when compiling in release. So you'll need to add it for both both debug and release.
.. or just use the pragmas :)
 
#pragma

#pragma

Keep in mind though, that if you plan on writing cross platform code, then #pragma includes are not a good thing to become dependent on. I still chuckle though, because the author of the OpenGL Superbible once told me that using #pragma to include library files is for lazy programmers :)

Until next time,
Schmedly
 
Back
Top