Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

victor_mf2

Member Since 29 Feb 2012
Offline Last Active Feb 29 2012 09:28 PM
-----

Topics I've Started

Undefined References C++

29 February 2012 - 08:50 PM

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:
g++ -Wall main.cpp -lglut32 -lglu32 -lopengl32


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?

PARTNERS