Jump to content
  • Advertisement
Sign in to follow this  
victor_mf2

OpenGL Undefined References C++

This topic is 2484 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 everyone,

I'm having some problem compiling my c++ application.
Here is the code:
main.cpp

#define GLUT_DISABLE_ATEXIT_HACK
#include <GL/gl.h>
#include <GL/glut.h>

/*
*
*/
int main(int argc, char** argv) {

glutInit(&argc, argv);
glutInitWindowPosition(0, 0);
glutInitWindowSize(300, 400);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
glutCreateWindow("Bla");

return 0;
}


To compile I'm using:
[color=#808080][font=courier new,courier,monospace]g++ -Wall main.cpp -lglut32 -lglu32 -lopengl32[/font]


Then i get this output on my console:

undefined reference to `glutInit'
undefined reference to `glutInitWindowPosition'
undefined reference to `glutInitWindowSize'
undefined reference to `glutInitDisplayMode'
undefined reference to `glutCreateWindow'

What can i do to get rid of this?

Share this post


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

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!