Undefined References C++

Started by
0 comments, last by victor_mf2 12 years, 1 month ago
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?
Advertisement
Just reinitialized the console and it worked.

This topic is closed to new replies.

Advertisement