LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
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 03-18-2011, 06:07 PM   #1
m4h
LQ Newbie
 
Registered: Mar 2011
Posts: 10

Rep: Reputation: 0
Please help!


Hi

I have to use OpenGL for a simple game project and have trouble compiling. I'm currently running Backtrack4 (as the Linux environment for coding) through VirtualBox in Windows7 and I code using C++. I have three problems:

1. The computer I use to do the coding on, doesn't have Internet access so I had to download the mesa-utils using another computer and then installed them manually (copying the appropriate files into the /usr/include/ folders - lib, GL, and share respectively). I'm not sure if I did it correctly, because:

2. When I try to compile I get the following errors:

/usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.3.2/../../../../lib/libglut.a when searching for -lglut

/usr/bin/ld: skipping incompatible /usr/lib/../lib/libglut.a when searching for -lglut

/usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.3.2/../../../libglut.a when searching for -lglut

/usr/bin/ld: skipping incompatible /usr/lib/libglut.a when searching for -lglut

/usr/bin/ld: cannot find -lglut
collect2: ld returned 1 exit status

So, it seems as if it can't find -lglut...

3. I'm not sure how to compile:
g++ -lGL -lGLU -lglut main.C -o main
OR
gcc -lGL -lGLU -lglut main.C -o main

I know these are probably really stupid questions, but I would greatly appreciate it if someone can help me.

Thank you
m4h

Last edited by m4h; 03-19-2011 at 02:37 AM.
 
Old 03-18-2011, 06:42 PM   #2
corp769
Guru
 
Registered: Apr 2005
Posts: 5,814

Rep: Reputation: 1001Reputation: 1001Reputation: 1001Reputation: 1001Reputation: 1001Reputation: 1001Reputation: 1001Reputation: 1001
Do you have libglut-devel fully installed?
 
Old 03-18-2011, 10:35 PM   #3
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 453Reputation: 453Reputation: 453Reputation: 453Reputation: 453
Quote:
Originally Posted by m4h View Post
Hi

I have to use OpenGL for a simple game project and have trouble compiling. I'm currently running Backtrack4 (as the Linux environment for coding) through VirtualBox in Windows7 and I code using C++. I have three problems:

1. The computer I use to do the coding on, doesn't have Internet access so I had to download the mesa-utils using another computer and then installed them manually (copying the appropriate files into the /usr/include/ folders - lib, GL, and share respectively). I'm not sure if I did it correctly, because:

2. When I try to compile I get the following errors:

/usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.3.2/../../../../lib/libglut.a when searching for -lglut

/usr/bin/ld: skipping incompatible /usr/lib/../lib/libglut.a when searching for -lglut

/usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.3.2/../../../libglut.a when searching for -lglut

/usr/bin/ld: skipping incompatible /usr/lib/libglut.a when searching for -lglut

/usr/bin/ld: cannot find -lglut
collect2: ld returned 1 exit status

So, it seems as if it can't find -lglut...

3. I'm not sure how to compile:
g++ -lGL -lGLU -lglut main.C -o main
OR
gcc -lGL -lGLU -lglut main.C -o main

I know these are probably really stupid questions, but I would greatly appreciate it if someone can help me.

Thank you
m4h
It may be you are running a 64 bit OS, but the libraries you have (the "i486" part) suggests you 32 bit libraries and 64 bit ones.
 
Old 03-19-2011, 02:02 AM   #4
John VV
Guru
 
Registered: Aug 2005
Posts: 13,446

Rep: Reputation: 1798Reputation: 1798Reputation: 1798Reputation: 1798Reputation: 1798Reputation: 1798Reputation: 1798Reputation: 1798Reputation: 1798Reputation: 1798Reputation: 1798
glut has a VERY LONG and very well documented instructions in the source
for windows
mac
and linux
even for sun

you might want to read them
AND VERY VERY IMPORTANT
CHANGE THE NAME TO SOMETHING USEFUL LIKE
"help with building glut"
 
Old 03-19-2011, 02:39 AM   #5
m4h
LQ Newbie
 
Registered: Mar 2011
Posts: 10

Original Poster
Rep: Reputation: 0
corp769, how would I know if I have it fully installed? What files should be where? As I have said, I had to manually copy the files from the mesa-package to their corresponding folders in root/usr. I haven't done anything other than that.
 
Old 03-19-2011, 04:00 AM   #6
John VV
Guru
 
Registered: Aug 2005
Posts: 13,446

Rep: Reputation: 1798Reputation: 1798Reputation: 1798Reputation: 1798Reputation: 1798Reputation: 1798Reputation: 1798Reputation: 1798Reputation: 1798Reputation: 1798Reputation: 1798
glut
http://www.opengl.org/resources/libr..._downloads.php
in the source are the instructions
and part of them is that YOU have to copy/paste the *.so or *.a into /usr/lib
did you ?
then did you run "ranlib"
and copy /paste the header files ( *.h) into /usr/include/GL
 
Old 03-19-2011, 05:14 AM   #7
m4h
LQ Newbie
 
Registered: Mar 2011
Posts: 10

Original Poster
Rep: Reputation: 0
I tried to copy the .so file into usr/lib but it gives an error stating "/usr/lib/libglut.so.3.9.0 does not exist". What should I do about that. Thanks a lot for trying to help me.
 
Old 03-19-2011, 08:29 AM   #8
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014.08, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 14,260

Rep: Reputation: 2660Reputation: 2660Reputation: 2660Reputation: 2660Reputation: 2660Reputation: 2660Reputation: 2660Reputation: 2660Reputation: 2660Reputation: 2660Reputation: 2660
Backtrack 4 is based on Ubuntu 8.10 Intrepid.
If you want to make things easier, then use a supported OS for development.
Ubuntu 8.10 has been unsupported for long time.

Ubuntu 8.10 glut :
freeglut3-dev_2.4.0-6.1_i386.deb freeglut3_2.4.0-6.1ubuntu1_i386.deb
The old archive http://old-releases.ubuntu.com/ubuntu/
> > http://old-releases.ubuntu.com/ubunt...in/f/freeglut/

.
 
Old 03-19-2011, 12:26 PM   #9
m4h
LQ Newbie
 
Registered: Mar 2011
Posts: 10

Original Poster
Rep: Reputation: 0
Thanks, I'll try to get the Ubuntu 8.10 glut and see if it works. After many unsuccessful attempts to obtain a distro that has a g++ compiler, Backtrack4 was the only one that had one, that's why I'm using Backtrack and not one of the other OSes.
 
Old 03-19-2011, 12:34 PM   #10
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014.08, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 14,260

Rep: Reputation: 2660Reputation: 2660Reputation: 2660Reputation: 2660Reputation: 2660Reputation: 2660Reputation: 2660Reputation: 2660Reputation: 2660Reputation: 2660Reputation: 2660
Quote:
.. obtain a distro that has a g++ compiler
All Linux OS has at least one g++ compiler, most have two to four
that can be installed at the same time.
Debian, Ubuntu, Mint : package names = g++ and g++-<version>.
Fedora, Mandriva, CentOS : package name = gcc-c++, compat-gcc34-c++.
Suse : package names = gcc-c++, gcc33-c++, gcc41-c++, gcc43-c++, gcc45-c++.
 
Old 03-19-2011, 12:53 PM   #11
Slackyman
Member
 
Registered: Mar 2011
Location: Rome - Italy
Distribution: Slackware 13.1
Posts: 347

Rep: Reputation: 44
Quote:
Originally Posted by knudfl View Post
All Linux OS has at least one g++ compiler, most have two to four
that can be installed at the same time.
Debian, Ubuntu, Mint : package names = g++ and g++-<version>.
Fedora, Mandriva, CentOS : package name = gcc-c++, compat-gcc34-c++.
Suse : package names = gcc-c++, gcc33-c++, gcc41-c++, gcc43-c++, gcc45-c++.
Slackware: gcc-g++-4.4.4
 
1 members found this post helpful.
Old 03-19-2011, 01:02 PM   #12
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014.08, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 14,260

Rep: Reputation: 2660Reputation: 2660Reputation: 2660Reputation: 2660Reputation: 2660Reputation: 2660Reputation: 2660Reputation: 2660Reputation: 2660Reputation: 2660Reputation: 2660
# 11 : Slackware is a good example. All basic development tools / files
are included, when the OS is installed. Ideal, when the OP has no internet.


Using Backtrack for development should be last choice.
Backtrack is meant to be used as a live cd for forensics only.

..
 
Old 03-19-2011, 04:02 PM   #13
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 453Reputation: 453Reputation: 453Reputation: 453Reputation: 453
Quote:
Originally Posted by m4h View Post
I tried to copy the .so file into usr/lib but it gives an error stating "/usr/lib/libglut.so.3.9.0 does not exist". What should I do about that. Thanks a lot for trying to help me.
You are doing it wrong - .so files are typically symbolic links.

Start from

http://www.yolinux.com/TUTORIALS/Lib...ndDynamic.html
http://www.faqs.org/docs/Linux-HOWTO...ary-HOWTO.html
http://linux.org/docs/ldp/howto/Prog...WTO/index.html

and, anyway, better use your distro package manager.
 
Old 03-22-2011, 01:18 AM   #14
m4h
LQ Newbie
 
Registered: Mar 2011
Posts: 10

Original Poster
Rep: Reputation: 0
Okay, thanks. I'll see if I can maybe get another OS installed and will use the links Sergei gave. Thanks again! Hope that everything is sorted out when I post here again.
 
  


Reply

Tags
library, opengl


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



All times are GMT -5. The time now is 02:39 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration