LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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
 
LinkBack Search this Thread
Old 12-03-2010, 06:24 AM   #1
kalimat
Member
 
Registered: Dec 2008
Posts: 30

Rep: Reputation: 0
OpenGL in Ubuntu


Hello , I would like to know what shall I install in Ubuntu(10.10) in order to get openGL. May be g++ , and other libraries; what they might be ?
What is your opinion about running openGL in Ubuntu rather than in Windows?
thanks
 
Old 12-03-2010, 07:33 AM   #2
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Kubuntu
Posts: 1,189

Rep: Reputation: 301Reputation: 301Reputation: 301Reputation: 301
Just install drivers with 3D support to your video card. g++ is for compiling programs not for OpenGL.
 
Old 12-03-2010, 07:45 AM   #3
kalimat
Member
 
Registered: Dec 2008
Posts: 30

Original Poster
Rep: Reputation: 0
ok but i want to install openGl to work in it...i think i need g++ for compiling also right?
i need something to replace visual c++ from windows may be
 
Old 12-03-2010, 07:49 AM   #4
sunnydrake
Member
 
Registered: Jul 2009
Location: Kiev,Ukraine
Distribution: Ubuntu,Slax,RedHat
Posts: 288
Blog Entries: 1

Rep: Reputation: 41
grab Mono / Monodevelop like M$ C#.. and opentk as opengl lib.
 
Old 12-03-2010, 09:14 AM   #5
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2013.07, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,218

Rep: Reputation: 2378Reputation: 2378Reputation: 2378Reputation: 2378Reputation: 2378Reputation: 2378Reputation: 2378Reputation: 2378Reputation: 2378Reputation: 2378Reputation: 2378
OpenGL > > libgl1-mesa-dev.

sudo apt-get install \
libgl1-mesa-dev libglu1-mesa-dev mono-1.0-devel g++

..
 
1 members found this post helpful.
Old 12-04-2010, 02:59 AM   #6
kalimat
Member
 
Registered: Dec 2008
Posts: 30

Original Poster
Rep: Reputation: 0
thank you knudfl! i have installed all.
now i should compile it by g++ file.cpp -o file ?
it says it doesnt find glut.h
 
Old 12-04-2010, 06:04 AM   #7
knobby67
Member
 
Registered: Mar 2006
Posts: 520

Rep: Reputation: 42
Are you talking about compiling the drivers? Or some piece of code using openGL? Apt installs everything for you, mesa drivers are not as fast as most cards openGL drivers, so if for example you've installed Nvidia drivers you don't need mesa. In Ubuntu open up synaptic package manager, do a search for glut, install the dev software.
Doing apt/synaptic you don't need to to compile. I think Unbutu has g++ installed in the basic build if not use synaptic to install build-essentials.
 
Old 12-04-2010, 06:22 AM   #8
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2013.07, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,218

Rep: Reputation: 2378Reputation: 2378Reputation: 2378Reputation: 2378Reputation: 2378Reputation: 2378Reputation: 2378Reputation: 2378Reputation: 2378Reputation: 2378Reputation: 2378
Quote:
now i should compile it by g++ file.cpp -o file ?
Looks OK. Just try it and see, what happens.

Most Unix / Linux commands are harmless, the easy way to practice
( and to memorize ) is to use the commands.

..

Last edited by knudfl; 12-04-2010 at 06:23 AM.
 
Old 12-04-2010, 08:31 AM   #9
kalimat
Member
 
Registered: Dec 2008
Posts: 30

Original Poster
Rep: Reputation: 0
yes, i am talking about compiling some piece of code using openGL.
i tried g++ file.cpp -o file
but it says it doesnt find glut.h
should i add something else in the command?
 
Old 12-04-2010, 12:11 PM   #10
knobby67
Member
 
Registered: Mar 2006
Posts: 520

Rep: Reputation: 42
Have you used synaptic package manager or apt to install glut?

If not install libglut3-dev

you also will need glut in your make or command line. Something like

g++ -o file -Wall -lglut -lGL file.cpp

Last edited by knobby67; 12-04-2010 at 12:15 PM.
 
Old 12-04-2010, 12:12 PM   #11
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2013.07, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,218

Rep: Reputation: 2378Reputation: 2378Reputation: 2378Reputation: 2378Reputation: 2378Reputation: 2378Reputation: 2378Reputation: 2378Reputation: 2378Reputation: 2378Reputation: 2378
The command is OK but you have no "glut"
sudo apt-get install libglut3-dev

http://packages.ubuntu.com/maverick/libglut3-dev
""GLUT (as in ``gluttony'') is a window system independent toolkit
for writing OpenGL programs. It implements a simple windowing API,
which makes life considerably easier when learning about and
exploring OpenGL programming. .... ""
.
 
Old 12-04-2010, 12:21 PM   #12
knobby67
Member
 
Registered: Mar 2006
Posts: 520

Rep: Reputation: 42
Quote:
Originally Posted by knudfl View Post
The command is OK but you have no "glut"
sudo apt-get install libglut3-dev

http://packages.ubuntu.com/maverick/libglut3-dev
""GLUT (as in ``gluttony'') is a window system independent toolkit
for writing OpenGL programs. It implements a simple windowing API,
which makes life considerably easier when learning about and
exploring OpenGL programming. .... ""
.
I don't know what your saying?
After you've installed libglut3-dev what error are you getting, can you cut and paste the error?
Also in you code headers you may need to set the glut header to gl folder

eg

#include <GL/glut.h>


or if it is set to that try

#include <glut.h>


or do a search to see where glut.h is.
 
Old 12-05-2010, 07:04 AM   #13
kalimat
Member
 
Registered: Dec 2008
Posts: 30

Original Poster
Rep: Reputation: 0
I installed all, now it says "undefined reference" to gluLookAt and gluPerspective .
(I tried to compile a program I had)
 
Old 12-06-2010, 01:58 AM   #14
knobby67
Member
 
Registered: Mar 2006
Posts: 520

Rep: Reputation: 42
You're not linking in the the library, have you put the lib in your make / command line? As shown above?

eg

g++ -o file -Wall -lglut -lGL file.cpp

I think you need to go to basics and look up how to compile code, look up linux glut opengl tutorials, there's 100's Nehe are good to start but out of date. He's the first I found on Google.#

http://www.cs.arizona.edu/classes/cs...ngl/index.html
 
Old 12-06-2010, 09:23 AM   #15
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2013.07, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,218

Rep: Reputation: 2378Reputation: 2378Reputation: 2378Reputation: 2378Reputation: 2378Reputation: 2378Reputation: 2378Reputation: 2378Reputation: 2378Reputation: 2378Reputation: 2378
Quote:
now it says "undefined reference" to gluLookAt and gluPerspective
May be your code is old ? ( And was meant for an older version of libGL.)
Which "Modified" date has it got ?

..
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
OpenGL in Ubuntu Linux 8.04 afa_linux Linux - General 2 12-15-2008 10:22 PM
OpenGL in Ubuntu under VirtualBox jmite Linux - Newbie 1 11-13-2008 06:09 PM
Installing OpenGL in Ubuntu 7.10 mmsprinter Linux - Software 3 01-08-2008 05:41 PM
Ubuntu OpenGL Screen Saver Bug? Wheat_Thins Linux - Software 1 11-26-2006 09:58 PM
how to install opengl pkg on linux with ubuntu 4.1 moondog1129 Linux - Laptop and Netbook 1 02-21-2006 03:46 PM


All times are GMT -5. The time now is 02:47 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration