Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Getting OpenGL/GLUT to work
Index -> Programming, C++ -> C++ Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
102jon




PostPosted: Wed Dec 15, 2010 5:25 pm   Post subject: Getting OpenGL/GLUT to work

Hi, I'm working on my first graphics project using the Codeblocks IDE with MinGW compiler. I recently downloaded freeglut for windows. In my source code I made sure to include the GL/glut.h file, however I receive this error message upon compiling:


ld.exe||cannot find -lglut32|
||=== Build finished: 1 errors, 0 warnings ===|

Any insight would be greatly appreciated.
Sponsor
Sponsor
Sponsor
sponsor
102jon




PostPosted: Wed Dec 15, 2010 5:28 pm   Post subject: Re: Getting OpenGL/GLUT to work

Correction, my compiler is GNU GCC.
TerranceN




PostPosted: Wed Dec 15, 2010 5:31 pm   Post subject: RE:Getting OpenGL/GLUT to work

Thats a linker error. Basically glut.h defines classes, and functions, etc which are then implemented in the glut32.lib file. -lglut32 just tells the linker that you need to include the glut32.lib file in the executable. The problem it is having is just as it says, it cannot find glut32.lib. In codeblocks, go Settings->Compiler and Debugger->Search Directories->Linker and make sure the glut32.lib file is in one of those directories.
102jon




PostPosted: Wed Dec 15, 2010 5:37 pm   Post subject: Re: Getting OpenGL/GLUT to work

When I downloaded freeglut, the only .lib file there is freeglut.lib. Did I download the wrong windows binary or something?
TerranceN




PostPosted: Wed Dec 15, 2010 6:10 pm   Post subject: RE:Getting OpenGL/GLUT to work

Whoops, my eyes jumped over the part where you mentioned freeglut. Freeglut uses freeglut.lib, but in order to make it compatible with other people's code, the creators decided to use the same name as glut's header file, "GL/glut.h".Well if the lib is freeglut.lib you should be able to use the linker option -lfreeglut to link with it. And you can always use Settings->Compiler and Debugger->Linker->Link Libraries because you show Codeblocks both the library and its directory.
Display posts from previous:   
   Index -> Programming, C++ -> C++ Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 5 Posts ]
Jump to:   


Style:  
Search: