LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 02-07-2006, 08:43 AM   #1
fadelhomsi
Member
 
Registered: Dec 2005
Location: Syria
Distribution: Suse, Mandriva
Posts: 52

Rep: Reputation: 15
OpenGL in linux


Hello,
when I compile OpenGL programs in My mandriva 10 I got errors like unreferenced statement.
How I could solve this problem???
best regards.
 
Old 02-07-2006, 10:53 AM   #2
ForYouAndI.com
Member
 
Registered: Jan 2006
Distribution: Debian
Posts: 82

Rep: Reputation: 15
make sure you're linking to the opengl libraries. To really get answers, you need to provide more detail.
 
Old 02-07-2006, 03:19 PM   #3
fadelhomsi
Member
 
Registered: Dec 2005
Location: Syria
Distribution: Suse, Mandriva
Posts: 52

Original Poster
Rep: Reputation: 15
Well this is what are shown when I try to compile one of the examples provided with qt3, GLBox


glbox.o(.text+0x117): In function `GLBox::~GLBox()':
: undefined reference to `glDeleteLists'
glbox.o(.text+0x187): In function `GLBox::~GLBox()':
: undefined reference to `glDeleteLists'
glbox.o(.text+0x1f7): In function `GLBox::~GLBox()':
: undefined reference to `glDeleteLists'
glbox.o(.text+0x255): In function `GLBox:aintGL()':
: undefined reference to `glClear'
glbox.o(.text+0x25a): In function `GLBox:aintGL()':
: undefined reference to `glLoadIdentity'
glbox.o(.text+0x26f): In function `GLBox:aintGL()':
: undefined reference to `glTranslatef'
glbox.o(.text+0x285): In function `GLBox:aintGL()':
: undefined reference to `glScalef'
glbox.o(.text+0x29f): In function `GLBox:aintGL()':
: undefined reference to `glRotatef'
glbox.o(.text+0x2b9): In function `GLBox:aintGL()':
: undefined reference to `glRotatef'
glbox.o(.text+0x2d3): In function `GLBox:aintGL()':
: undefined reference to `glRotatef'
glbox.o(.text+0x361): In function `GLBox::resizeGL(int, int)':
: undefined reference to `glViewport'
glbox.o(.text+0x36d): In function `GLBox::resizeGL(int, int)':
: undefined reference to `glMatrixMode'
glbox.o(.text+0x372): In function `GLBox::resizeGL(int, int)':
: undefined reference to `glLoadIdentity'
glbox.o(.text+0x3b0): In function `GLBox::resizeGL(int, int)':
: undefined reference to `glFrustum'
glbox.o(.text+0x3f3): In function `GLBox::makeObject()':
: undefined reference to `glGenLists'
glbox.o(.text+0x408): In function `GLBox::makeObject()':
: undefined reference to `glNewList'
glbox.o(.text+0x42a): In function `GLBox::makeObject()':
: undefined reference to `glLineWidth'
glbox.o(.text+0x436): In function `GLBox::makeObject()':
: undefined reference to `glBegin'
glbox.o(.text+0x44e): In function `GLBox::makeObject()':
: undefined reference to `glVertex3f'
glbox.o(.text+0x462): In function `GLBox::makeObject()':
: undefined reference to `glVertex3f'
glbox.o(.text+0x476): In function `GLBox::makeObject()':
: undefined reference to `glVertex3f'
glbox.o(.text+0x48e): In function `GLBox::makeObject()':
: undefined reference to `glVertex3f'
glbox.o(.text+0x493): In function `GLBox::makeObject()':
: undefined reference to `glEnd'
glbox.o(.text+0x49f): In function `GLBox::makeObject()':
: undefined reference to `glBegin'
glbox.o(.text+0x4b3): In function `GLBox::makeObject()':
: undefined reference to `glVertex3f'
glbox.o(.text+0x4c3): In function `GLBox::makeObject()':
: undefined reference to `glVertex3f'
glbox.o(.text+0x4d3): In function `GLBox::makeObject()':
: undefined reference to `glVertex3f'
glbox.o(.text+0x4e7): In function `GLBox::makeObject()':
: undefined reference to `glVertex3f'
glbox.o(.text+0x4ec): In function `GLBox::makeObject()':
: undefined reference to `glEnd'
glbox.o(.text+0x4f8): In function `GLBox::makeObject()':
: undefined reference to `glBegin'
glbox.o(.text+0x510): In function `GLBox::makeObject()':
: undefined reference to `glVertex3f'
glbox.o(.text+0x524): In function `GLBox::makeObject()':
: undefined reference to `glVertex3f'
glbox.o(.text+0x538): In function `GLBox::makeObject()':
: undefined reference to `glVertex3f'
glbox.o(.text+0x548): In function `GLBox::makeObject()':
: undefined reference to `glVertex3f'
glbox.o(.text+0x55c): In function `GLBox::makeObject()':
: undefined reference to `glVertex3f'
glbox.o(.text+0x56c): more undefined references to `glVertex3f' follow
glbox.o(.text+0x59d): In function `GLBox::makeObject()':
: undefined reference to `glEnd'
glbox.o(.text+0x5a2): In function `GLBox::makeObject()':
: undefined reference to `glEndList'
glbox.o(.text+0x2f1): In function `GLBox:aintGL()':
: undefined reference to `glCallList'
glbox.o(.text+0x338): In function `GLBox::initializeGL()':
: undefined reference to `glShadeModel'
glbox.o(.text+0x3c1): In function `GLBox::resizeGL(int, int)':
: undefined reference to `glMatrixMode'
collect2: ld returned 1 exit status
make: *** [tmp] Error 1

best regards.
 
Old 02-07-2006, 06:49 PM   #4
xhi
Senior Member
 
Registered: Mar 2005
Location: USA::Pennsylvania
Distribution: Slackware
Posts: 1,065

Rep: Reputation: 45
what string are you using to compile...

g++ ........ ?
 
Old 02-08-2006, 03:12 AM   #5
fadelhomsi
Member
 
Registered: Dec 2005
Location: Syria
Distribution: Suse, Mandriva
Posts: 52

Original Poster
Rep: Reputation: 15
I use make to compile my program.
 
Old 02-08-2006, 05:41 AM   #6
ForYouAndI.com
Member
 
Registered: Jan 2006
Distribution: Debian
Posts: 82

Rep: Reputation: 15
Looks to me like the opengl is not installed or is not in your path.
 
Old 02-08-2006, 07:24 AM   #7
xhi
Senior Member
 
Registered: Mar 2005
Location: USA::Pennsylvania
Distribution: Slackware
Posts: 1,065

Rep: Reputation: 45
Quote:
Originally Posted by fadelhomsi
I use make to compile my program.
well it looks as if your problem is that the needed opengl libs are not there to be linked..

you need to specify a path and lib name to g++ so it can link your executable with the gl libs, and it is not finding it..

investigate the makefile.. odds are its just looking in the wrong place..
 
Old 02-09-2006, 12:03 AM   #8
fadelhomsi
Member
 
Registered: Dec 2005
Location: Syria
Distribution: Suse, Mandriva
Posts: 52

Original Poster
Rep: Reputation: 15
well, with my Suse10 it works:
I tried gcc,
but with my mandrake10, the compiler shows this message:
/usr/bin/ld: cannot find -lglut
collect2: ld returned 1 exit status

thanks 4 all.
 
Old 02-09-2006, 09:21 AM   #9
xhi
Senior Member
 
Registered: Mar 2005
Location: USA::Pennsylvania
Distribution: Slackware
Posts: 1,065

Rep: Reputation: 45
well you would need to find out if you have glut, and where it is located.. then pass it to gcc..

ex
g++ -L/path/to/glut/lib/dir -lglut source.cpp
 
  


Reply



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
Overwrite Mesa OpenGL with ATI OpenGL Carl-Fredrik Slackware 12 10-01-2004 03:33 PM
Opengl and Linux? drdroid Programming 8 12-08-2003 06:36 AM
opengl and Linux DDR extreme Linux - Newbie 4 10-17-2003 10:25 AM
Changing from MESA OpenGL to ATI OpenGL tillyoubreakit Linux - Hardware 19 10-07-2003 07:32 PM
Can i use openGL in Linux? apit Programming 1 03-06-2003 07:46 PM

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

All times are GMT -5. The time now is 01:50 AM.

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
Open Source Consulting | Domain Registration