PDA

View Full Version : Linux compilation problem



Mishuk
12-14-2002, 09:31 AM
HI!
I'm trying to compile the Nehe code in my linux box. But the Makefile isn't working.
It shows follwing error:

[dddd@localhost lesson05]$ ./Makefile
./Makefile: CC: command not found
./Makefile: all:: command not found
./Makefile: CC: command not found
./Makefile: lesson05.c: command not found
./Makefile: clean:: command not found
./Makefile: @echo: command not found
./Makefile: @rm: command not found
./Makefile: @echo: command not found
[mishuk@localhost lesson05]$

It also creating error with every gl command as unidentified variable or function.

I think may be there is some problem in my environment variable of my system.

How to fix it..?? How can i fix environment variable problem.....anyother openion is highly requested.....

Thank you
Mishuk

Omaha
12-14-2002, 10:17 AM
This is really more of a Linux problem than an OpenGL problem.

Just type "make".

Mishuk
12-15-2002, 05:41 AM
Thanks.
You are right....it was my mistake...
But now i'm facing another problem....
My code is not compiling.....

I tried to compile Nehe lesson05 of GLX version

Here is error:

How can i solve it??
Please help me

###############################################

[mishuk@localhost lesson05]$ make
gcc -Wall -pedantic -ansi lesson05.c -o lesson05 -L/usr/X11R6/lib -lGL -lGLU -lX11 -lXxf86vm
lesson05.c: In function `main':
lesson05.c:375: warning: implicit declaration of function `exit'
/usr/X11R6/lib/libGL.a(glxext.o): In function `__glXGetCurrentContext':
glxext.o(.text+0x1a): undefined reference to `pthread_key_create'
glxext.o(.text+0x31): undefined reference to `pthread_getspecific'
/usr/X11R6/lib/libGL.a(glxext.o): In function `__glXSetCurrentContext':
glxext.o(.text+0x6a): undefined reference to `pthread_key_create'
glxext.o(.text+0x87): undefined reference to `pthread_setspecific'
/usr/X11R6/lib/libGL.a(glxext.o): In function `__glXFindDisplay':
glxext.o(.text+0x175): undefined reference to `XextCreateExtension'
glxext.o(.text+0x192): undefined reference to `XextFindDisplay'
glxext.o(.text+0x1b8): undefined reference to `XextAddDisplay'
/usr/X11R6/lib/libGL.a(glxext.o): In function `__glXInitialize':
glxext.o(.text+0x7fe): undefined reference to `XMissingExtension'
/usr/X11R6/lib/libGL.a(glxext.o): In function `__glXCloseDisplay':
glxext.o(.text+0xdd): undefined reference to `XextRemoveDisplay'
/usr/X11R6/lib/libGL.a(glthread.o): In function `_glthread_InitTSD':
glthread.o(.text+0x1e): undefined reference to `pthread_key_create'
/usr/X11R6/lib/libGL.a(glthread.o): In function `_glthread_GetTSD':
glthread.o(.text+0x76): undefined reference to `pthread_getspecific'
/usr/X11R6/lib/libGL.a(glthread.o): In function `_glthread_SetTSD':
glthread.o(.text+0xbf): undefined reference to `pthread_setspecific'
/usr/X11R6/lib/libGL.a(XF86dri.o): In function `find_display':
XF86dri.o(.text+0x14): undefined reference to `XextCreateExtension'
XF86dri.o(.text+0x31): undefined reference to `XextFindDisplay'
XF86dri.o(.text+0x57): undefined reference to `XextAddDisplay'
/usr/X11R6/lib/libGL.a(XF86dri.o): In function `XF86DRIQueryVersion':
XF86dri.o(.text+0xfd): undefined reference to `XMissingExtension'
/usr/X11R6/lib/libGL.a(XF86dri.o): In function `XF86DRIQueryDirectRenderingCapable':
XF86dri.o(.text+0x21d): undefined reference to `XMissingExtension'
/usr/X11R6/lib/libGL.a(XF86dri.o): In function `XF86DRIOpenConnection':
XF86dri.o(.text+0x331): undefined reference to `XMissingExtension'
/usr/X11R6/lib/libGL.a(XF86dri.o): In function `XF86DRIAuthConnection':
XF86dri.o(.text+0x4cd): undefined reference to `XMissingExtension'
/usr/X11R6/lib/libGL.a(XF86dri.o): In function `XF86DRICloseConnection':
XF86dri.o(.text+0x5ed): undefined reference to `XMissingExtension'
/usr/X11R6/lib/libGL.a(XF86dri.o)(.text+0x6b1): more undefined references to `XMissingExtension' follow
/usr/X11R6/lib/libGL.a(XF86dri.o): In function `close_display':
XF86dri.o(.text+0x88): undefined reference to `XextRemoveDisplay'
/usr/X11R6/lib/libXxf86vm.a(XF86VMode.o): In function `find_display':
XF86VMode.o(.text+0x14): undefined reference to `XextCreateExtension'
XF86VMode.o(.text+0x31): undefined reference to `XextFindDisplay'
XF86VMode.o(.text+0x57): undefined reference to `XextAddDisplay'
/usr/X11R6/lib/libXxf86vm.a(XF86VMode.o): In function `XF86VidModeQueryVersion':
XF86VMode.o(.text+0x101): undefined reference to `XMissingExtension'
/usr/X11R6/lib/libXxf86vm.a(XF86VMode.o): In function `XF86VidModeSetClientVersion':
XF86VMode.o(.text+0x22d): undefined reference to `XMissingExtension'
/usr/X11R6/lib/libXxf86vm.a(XF86VMode.o): In function `XF86VidModeSetGamma':
XF86VMode.o(.text+0x301): undefined reference to `XMissingExtension'
/usr/X11R6/lib/libXxf86vm.a(XF86VMode.o): In function `XF86VidModeGetGamma':
XF86VMode.o(.text+0x431): undefined reference to `XMissingExtension'
/usr/X11R6/lib/libXxf86vm.a(XF86VMode.o): In function `XF86VidModeGetModeLine':
XF86VMode.o(.text+0x583): undefined reference to `XMissingExtension'
/usr/X11R6/lib/libXxf86vm.a(XF86VMode.o)(.text+0x819): more undefined references to `XMissingExtension' follow
/usr/X11R6/lib/libXxf86vm.a(XF86VMode.o): In function `close_display':
XF86VMode.o(.text+0x88): undefined reference to `XextRemoveDisplay'
/usr/lib/gcc-lib/i386-redhat-linux/2.96/libgcc.a(_eh.o): In function `eh_context_free':
/usr/src/build/87732-i386/BUILD/gcc-2.96-20000731/obj-i386-redhat-linux/gcc/../../gcc/libgcc2.c(.text+0x114): undefined reference to `pthread_setspecific'
/usr/lib/gcc-lib/i386-redhat-linux/2.96/libgcc.a(_eh.o): In function `eh_threads_initialize':
/usr/src/build/87732-i386/BUILD/gcc-2.96-20000731/obj-i386-redhat-linux/gcc/../../gcc/libgcc2.c(.text+0x231): undefined reference to `pthread_key_create'
/usr/lib/gcc-lib/i386-redhat-linux/2.96/libgcc.a(_eh.o): In function `eh_context_specific':
/usr/src/build/87732-i386/BUILD/gcc-2.96-20000731/obj-i386-redhat-linux/gcc/../../gcc/libgcc2.c(.text+0x38b): undefined reference to `pthread_getspecific'
/usr/src/build/87732-i386/BUILD/gcc-2.96-20000731/obj-i386-redhat-linux/gcc/../../gcc/libgcc2.c(.text+0x3ab): undefined reference to `pthread_setspecific'
collect2: ld returned 1 exit status
make: *** [all] Error 1
[mishuk@localhost lesson05]$

147-2
12-16-2002, 12:16 PM
Looks like a failure to load libpthread. I suggest you look into the Makefile, and add "-lpthread" to the argument set where the object files are linked.

nexusone
12-16-2002, 12:55 PM
You have another option, download the QT C/C++ gui interface from www.trolltech.com (http://www.trolltech.com)

Easy to setup and start writting OpenGL programs, don't have to worry about making manual make files.


I think it still comes with Redhat linux, so you can also download Redhat and it will be installed with all the openGL librarys.