28.02.2012

[olej@notebook GLUT]$ gcc glut.c 
/tmp/cc61pO6J.o: In function `Reshape':
simple.c:(.text+0x24): undefined reference to `glViewport'
simple.c:(.text+0x30): undefined reference to `glMatrixMode'
simple.c:(.text+0x35): undefined reference to `glLoadIdentity'
simple.c:(.text+0x59): undefined reference to `gluOrtho2D'
simple.c:(.text+0x65): undefined reference to `glMatrixMode'
/tmp/cc61pO6J.o: In function `Draw':
simple.c:(.text+0x79): undefined reference to `glClear'
simple.c:(.text+0x98): undefined reference to `glColor3f'
simple.c:(.text+0xa5): undefined reference to `glLineWidth'
simple.c:(.text+0xb1): undefined reference to `glBegin'
simple.c:(.text+0xc7): undefined reference to `glVertex2f'
simple.c:(.text+0xdd): undefined reference to `glVertex2f'
simple.c:(.text+0xe2): undefined reference to `glEnd'
simple.c:(.text+0xe7): undefined reference to `glFlush'
/tmp/cc61pO6J.o: In function `main':
simple.c:(.text+0x104): undefined reference to `glutInit'
simple.c:(.text+0x118): undefined reference to `glutInitWindowSize'
simple.c:(.text+0x12c): undefined reference to `glutInitWindowPosition'
simple.c:(.text+0x138): undefined reference to `glutCreateWindow'
simple.c:(.text+0x144): undefined reference to `glutReshapeFunc'
simple.c:(.text+0x150): undefined reference to `glutDisplayFunc'
simple.c:(.text+0x178): undefined reference to `glClearColor'
simple.c:(.text+0x17d): undefined reference to `glutMainLoop'
collect2: выполнение ld завершилось с кодом возврата 1

-----------------------------------------------------------------------------

[olej@notebook lib]$ pwd
/usr/lib

[olej@notebook lib]$ sudo ln -s libglut.so.3 libglut.so

[olej@notebook lib]$ ls -l libglut*
lrwxrwxrwx 1 root root     12 Фев 28 16:13 libglut.so -> libglut.so.3
lrwxrwxrwx 1 root root     16 Окт 17 14:08 libglut.so.3 -> libglut.so.3.9.0
-rwxr-xr-x 1 root root 227904 Ноя 28  2009 libglut.so.3.9.0


[olej@notebook glut]$ make
cc glut.c -o glut -lX11 -lglut
/tmp/ccbpxVpD.o: In function `Reshape':
glut.c:(.text+0x59): undefined reference to `gluOrtho2D'
collect2: выполнение ld завершилось с кодом возврата 1
make: *** [glut] Ошибка 1

-----------------------------------------------------------------------------

[olej@notebook glut]$ make
cc glut.c -o glut -lX11 -lglut

[olej@notebook glut]$ ./glut 
[olej@notebook glut]$ 

-----------------------------------------------------------------------------
