LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   need help compiling program that uses glx (https://www.linuxquestions.org/questions/programming-9/need-help-compiling-program-that-uses-glx-325101/)

SciYro 05-19-2005 02:06 PM

need help compiling program that uses glx
 
ok, i have a small program I'm tying to compile, it uses 2 glx functions (glxChooseVisual) and no other opengl or glx/glu/glut functions, but i cant get it to compile, the eror is here:

Code:

/tmp/cc0x3T5l.o(.text+0x107): In function `funct_1':
: undefined reference to `glxChooseVisual'
/tmp/cc0x3T5l.o(.text+0x12a): In function `funct_1':
: undefined reference to `glxChooseVisual'
collect2: ld returned 1 exit status

heres the command i use
Code:

gcc main.c -o test -lGL -lX11
the funny thing is, i had another opengl program (one that used glxChooseVisual and actual opengl to draw some triangles), the same compile command worked on it (both programs are on the same computer, and same everything), but in this new one, i cant get it to get past that error. any ideas?

dugas 05-20-2005 01:50 AM

flags, libs
 
try
gcc -o foo main.c -I/usr/X11R6/include -L/usr/X11R6/lib -lglut -lGL -lGLU -lX11 -lXmu -lXi -lm

SciYro 05-20-2005 01:23 PM

hmm, nope, still same error :(

Harmaa Kettu 05-20-2005 01:49 PM

The X in the function name should be uppercase.

SciYro 05-20-2005 04:30 PM

thanks Harmaa Kettu!, compiled perfectly.


All times are GMT -5. The time now is 09:56 PM.