Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


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