ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
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.
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.
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.
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
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.
Distribution: pclos2010.12, Slack1337 DebSqueeze, +50+ other Linux OS, for test only.
Posts: 9,302
Rep:
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.
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.
Distribution: pclos2010.12, Slack1337 DebSqueeze, +50+ other Linux OS, for test only.
Posts: 9,302
Rep:
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++.
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++.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.