PDA

View Full Version : cant make a file



tharageorge
03-31-2013, 04:40 AM
i need help i cant make a file
this is d error they show
please help me i am new to linux and opengl
TexCoord2f'
/tmp/cclc6g9p.o:main.cpp:function drawScene(): error: undefined reference to 'glTexCoord2f'
/tmp/cclc6g9p.o:main.cpp:function drawScene(): error: undefined reference to 'glEnd'
/tmp/cclc6g9p.o:main.cpp:function drawScene(): error: undefined reference to 'glDisable'
collect2: ld returned 1 exit status
make: *** [cube] Error

Dark Photon
03-31-2013, 12:59 PM
Add -lGL to the link line. For instance:



g++ -o tst tst.C -lGL


Depending on what your program uses, you may also want -lglut -lGLU -lGL.

If you still get some undefined gl* symbols, you may very well just need to install the OpenGL drivers for your GPU. Post back if you have more problems.

tharageorge
04-01-2013, 07:27 AM
i did install everything required for opengl
using ths three commands
1) sudo apt-get update
2) sudo apt-get install build-essential
3) sudo apt-get install freeglut3-dev

tharageorge
04-01-2013, 07:28 AM
my error
samsung@ubuntu:~/Desktop$ g++ -o tst test.c -lGL
/tmp/ccPP3dla.o:test.c:function display(): error: undefined reference to 'glutSwapBuffers'
/tmp/ccPP3dla.o:test.c:function key(unsigned char, int, int): error: undefined reference to 'glutPostRedisplay'
/tmp/ccPP3dla.o:test.c:function idle(): error: undefined reference to 'glutPostRedisplay'
/tmp/ccPP3dla.o:test.c:function main: error: undefined reference to 'glutInit'
/tmp/ccPP3dla.o:test.c:function main: error: undefined reference to 'glutInitWindowSize

skeezix6
04-01-2013, 09:21 AM
Now try g++ -o tst test.c -lGL -lglut