Reputation: 7164
I can run my C++ codes that use OpenGL on Terminal with the following code :
g++ -Wall main.cpp -lglut -lGL -lGLU -lGLEW
I want to use Netbeans while I'm working on OpenGL. When I write the code on Netbeans and run I get many errors like :
/home/../NetBeansProjects/CppApplication_2/main.cpp:36: undefined reference to `glutInit'
How can I make Netbeans compile and run my code correctly? Do I need to edit the makefile, if yes, how?
Upvotes: 1
Views: 3104
Reputation: 2663
You have to link the GLUT library. Follow the following setps for windows machine:
Follow this answer for details NetBeans with C++ and OpenGL / Freeglut under Windows 7
http://forums.netbeans.org/post-29474.html
Upvotes: 2