Jump to content
  • Advertisement
Sign in to follow this  
johnmr531

OpenGL and the GLUT getting linker errors from OpenGL Super Bible book

This topic is 4869 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi Ive just started learning how to program in OpenGL using the GLUT. My code compiles fine is MSVC++ 6.0 but when I try to execute it I get a linker error. I tried to link glut.lib and glut32.lib in the settings general link area but I get the link error. Im on windows XP Heres my code. From the OpenGL Super Bible book. #include <GL/glut.h> ////////////////////////////////////////////////////////////////////////////////////// // Called to draw scene void RenderScene(void) { // Clear the window with current clearing color glClear(GL_COLOR_BUFFER_BIT); // Flush drawing commands glFlush(); } ////////////////////////////////////////////////////////////////////////////////////// // Setup the rendering state void SetupRC(void) { glClearColor(0.0f, 0.0f, 1.0f, 1.0f); } ////////////////////////////////////////////////////////////////////////////////////// // Main program entry point int main(void) { glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB); glutCreateWindow("Simple"); glutDisplayFunc(RenderScene); SetupRC(); glutMainLoop(); return 0; } Thanks help would be much appreciated because Once I can it to link and execute I can continue on with the Book. The Books executable file for the this code works because I put the glut.dll in the windows system32 file. It just dont link when I try to execute.

Share this post


Link to post
Share on other sites
Advertisement
Do you have glut32.dll in the same directory as the program you're executing, or in a directory that's included in the PATH environment variable?

Share this post


Link to post
Share on other sites
Not in the project file.

In the same directory where the executable is, in the same folder where the compiled application is.

Share this post


Link to post
Share on other sites
Well guess what... I got it lol. You know what I did. Originally I had created a workspace with the nehe tutorial http://nehe.gamedev.net/
using a "win 32 application" and continued working in there. Where what I needed to do was be in the "console application"

Idiot mistake... Very sorry guys. It now works. And to think Ive wasted a couple hours for stupidity. Well atleast now I can continue on.

Thanx for your help

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!