Jump to content

  • Log In with Google      Sign In   
  • Create Account

We need your help!

We need 7 developers from Canada and 17 more from Australia to help us complete a research survey.

Support our site by taking a quick sponsored survey and win a chance at a $50 Amazon gift card. Click here to get started!


Undefined References C++


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 victor_mf2   Members   -  Reputation: 100

Like
0Likes
Like

Posted 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?

Sponsor:

#2 victor_mf2   Members   -  Reputation: 100

Like
0Likes
Like

Posted 29 February 2012 - 09:28 PM

Just reinitialized the console and it worked.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS