LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-19-2005, 03:06 PM   #1
SciYro
Senior Member
 
Registered: Oct 2003
Location: hopefully not here
Distribution: Gentoo
Posts: 2,038

Rep: Reputation: 51
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?
 
Old 05-20-2005, 02:50 AM   #2
dugas
Member
 
Registered: Jul 2004
Location: louisiana
Distribution: fedora 4/kubuntu
Posts: 116

Rep: Reputation: 15
flags, libs

try
gcc -o foo main.c -I/usr/X11R6/include -L/usr/X11R6/lib -lglut -lGL -lGLU -lX11 -lXmu -lXi -lm
 
Old 05-20-2005, 02:23 PM   #3
SciYro
Senior Member
 
Registered: Oct 2003
Location: hopefully not here
Distribution: Gentoo
Posts: 2,038

Original Poster
Rep: Reputation: 51
hmm, nope, still same error
 
Old 05-20-2005, 02:49 PM   #4
Harmaa Kettu
Member
 
Registered: Apr 2005
Location: Finland
Posts: 196

Rep: Reputation: 30
The X in the function name should be uppercase.
 
Old 05-20-2005, 05:30 PM   #5
SciYro
Senior Member
 
Registered: Oct 2003
Location: hopefully not here
Distribution: Gentoo
Posts: 2,038

Original Poster
Rep: Reputation: 51
thanks Harmaa Kettu!, compiled perfectly.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
help compiling a program minm Linux - Newbie 3 10-10-2005 02:14 AM
Compiling a Program? dbzw Linux - Software 4 10-09-2005 02:31 PM
Compiling a program lintho Linux - Software 2 08-24-2004 08:41 AM
Compiling Program Star3132 Linux - General 8 06-29-2004 06:35 AM
(II) [GLX]: Initializing GLX extension - X wont go hydro Linux - Software 3 02-20-2003 07:12 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration