Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

undefined reference to `_display' in openGL graphics package of cygwin
#1

Hi i am using openGL graphics package of cygwin to draw graphics.

But when i compile the program its giving the following errors:
Code:
$  gcc simplegraph.c -lm -lGL -lglut
/tmp/ccKAr3B6.o:simplegraph.c:(.text+0x38): undefined reference to `_glutInit'
/tmp/ccKAr3B6.o:simplegraph.c:(.text+0x44): undefined reference to `_glutInitDisplayMode'
/tmp/ccKAr3B6.o:simplegraph.c:(.text+0x58): undefined reference to `_glutInitWindowSize'
/tmp/ccKAr3B6.o:simplegraph.c:(.text+0x6c): undefined reference to `_glutInitWindowPosition'
/tmp/ccKAr3B6.o:simplegraph.c:(.text+0x78): undefined reference to `_glutCreateWindow'
/tmp/ccKAr3B6.o:simplegraph.c:(.text+0x7f): undefined reference to `_display'
/tmp/ccKAr3B6.o:simplegraph.c:(.text+0x84): undefined reference to `_glutDisplayFunc'
/tmp/ccKAr3B6.o:simplegraph.c:(.text+0x8b): undefined reference to `_reshape'
/tmp/ccKAr3B6.o:simplegraph.c:(.text+0x90): undefined reference to `_glutReshapeFunc'
/tmp/ccKAr3B6.o:simplegraph.c:(.text+0x95): undefined reference to `_glutMainLoop'
collect2: ld returned 1 exit status

The source file is as follows: simplegraph.c
Code:
#include <math.h>
#include <GL/glut.h>
#include <stdio.h>

void display();
void reshape(GLsizei w, GLsizei h);

int main(int argc, char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
glutInitWindowSize(250, 250);
glutInitWindowPosition(100, 100);
glutCreateWindow("Drawing sample");
glutDisplayFunc(display);
glutReshapeFunc(reshape);
glutMainLoop();

return 0;
}

Any thoughts on this one ???
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)