Click to See Complete Forum and Search --> : Mesa- OpenGL
noir-gel
07-10-2003, 02:43 PM
Hello all!
I'm new in JustLinux... My name is Álvaro.
I'm trying to understand some things:
my distribution (debian unstable) provides the mesa packages in 2 versions:
xlibmesa (with other suffixes and prefixes, glut, etc...)
mesag3 (the same)
the difference is that mesag3 offers seems to be version 5.0.1 (the latest) but xlibmesa is 4.x. But if I install mesag3 it forces me to uninstall the nvidia drivers I'v installed! So I decided to work with that other name for mesa packages, but... what should I do?
-----------
what are the differences between using MESA and OPENGL??
because I thought that OpenGL works better in LINUX (mesa) than in windows (and I don't want windows) but I'm having a lot of problems compiling programs in linux...
for example: where is the glaux.h header file that many opengl tutorials include?? I can't compile them...
-----------
Is it very problematic 3d proramming with C++/OpenGl/Glut in linux??
Or should I try with JAVA?? (please say no ;-) )
-----------
thanks everyone!!!!!!!!!!!!!!!!!!!!!!!
.alvaro.castro.
siqe
07-10-2003, 04:25 PM
If you installed drivers downloaded from the nvidia website then you have a real opengl implementation on your system. http://members.cox.net/gradyfield/oglcaps.html libGL and libGLU should be some where like /usr/lib/. glaux is outdated and might not be included in your install, but all of your opengl related headers should be in /usr/include/GL. http://nehe.gamedev.net/ has lots of tutorials that don't use glaux.
Mesa is an opengl clone. it only renders in software. it can't actually use the GPU on the video card so that really sucks.
It is not problematic at all using opegnl in linux with gcc, I'm working on project right now and it works fine, better than in windows because the windows people are all stuck on opengl 1.1 because MS won't update the opengl32.dll . Maybe if you have an ATI card it is hard to get the drivers working, but I'm not sure about this. glut is outdated and you should use SDL www.libsdl.org for all that stuff if you have to have a wrapper for doing window management and all that.
noir-gel
07-10-2003, 08:45 PM
...then if I install the nvidia(.com) drivers (which I have installed) then I get the opengl libraries.
but... what happens with the include files for developing programs? do they install them?
Then, should I uninstall all mesa libraries?? (that sounds good :-) )
THANK YOU VERY MUCH!!!!
.alvaro.castro.
siqe
07-10-2003, 09:29 PM
If you run that program I put up at the cox website, and it says the vendor is nvidia, I think you got what you need as far as drivers. That is, if you link to libGL and libGLU you've got the good (hardware accelerated ) stuff. I wouldn't fool with uninstalling Mesa, because if you were me you would mess something up :)
As far as your headers go, everything that you absolutely have to have: gl.h, glu.h, glx.h should be in /usr/include/GL . The other stuff like glut.h glaux.h and glext.h aren't indespensible so they might not be there.
SDL might be on your computer too. Check for /usr/include/SDL and /usr/lib/libSDL* and see if you have anything.
bwkaz
07-10-2003, 10:54 PM
Originally posted by noir-gel
what happens with the include files for developing programs? do they install them? The nVidia drivers do put a few include files in /usr/share/doc/NVIDIA_GLX-1.0/, but they do not install them in /usr/include/GL, which is where they should be if you plan on using them.
However, using them is not always a good idea. Some versions of WineX, for example, do not build correctly against the nVidia header files, but do build correctly (and work just fine, even when linking against nVidia's libGL.so) against the default OpenGL headers installed by Mesa.
noir-gel
07-11-2003, 06:32 AM
...that sounds very strange...
but, then, if I use OpenGL/SDL I have to install:
Nvidia drivers from the company
Mesa3d (which version???? xlibmesa or mesa)
SDL libraries
...and then use mesa headers with the nvidia drivers??
(I thought that didn't work mesa with the hardware acceleration)
I think this is a mess or that I don't understand anything...
THANKS FOR YOUR HELP!!!!!!
.alvaro.castro.
acid45
05-31-2005, 09:19 AM
I seem to be having a related issue.
nVidia drivers 1.0.7174
kdevelope 3.1.2
KDE 3.3.2
The nVidia installer DOES install headers to /usr/doc/NVIDIA_GLX-1.0/include/GL no matter what you do. If you include the option --opengl-headers it should also install them in /usr/include/GL as well, or wherever your path is.
The OpenGL FAQ also has a list of links that should be present on the libraries after you've installed them.
I had Mesa3D installed which, I think, prevented me from installing my nVidia drivers at all. It mention expecting /usr/lib/libglx.so.1 but found /usr/local/lib/libglx.so.1, which I think was either the default libglx library for my distro, slack 10.1, or the mesa3D library. There were also mesa3d libraries in /usr/local/lib. I had to rename/remove these before my nVidia drivers would install.
You can manually install these headers without the --opengl-headers option by using the cp(copy) command.
I've manually copied the headers in /usr/doc/NVIDIA_GLX-1.0/include/GL/*.h to /lib/include/GL/
I cleaned my project which is just a sample from the redbook. It compiles fine. When I try to build or install this program I get undefined refrence to <insert gl/glut function here> I searched and searched, mostly through posts of people trying to install games and other programs. This 6kb/s browsing speed is getting on my nerves though...
library != header
#include <GL/gl.h>
/* included in glut.h but what-the-hay can't have a raid without redundant...or disks...
that's just be a smart-asci */
#include <GL/glu.h>
#include <GL/glx.h>
Actually I'm using Ogre now, and I even changed the linux distribution (to gentoo), so my problems now are very different and I forgot that issue...
This was 1 and a half years ago! ;-)
:-)
good luck!
bwkaz
05-31-2005, 06:32 PM
Originally posted by acid45
When I try to build or install this program I get undefined refrence to <insert gl/glut function here> Um, maybe it would help to show what gl/glut functions it complains about? ;)
Also, what link command got executed when you built your executable?
Last, I had to change "glrectf" in your display() function to "glRectf" before it would link successfully. But as long as I linked with "-lGL -lGLU -lglut -L/usr/X11R6/lib", it worked (I needed /usr/X11R6/lib for GLU, since I use Xorg's version of it).
acid45
06-04-2005, 10:51 AM
I'm having an issue with my OpenGL implementation and I can't quite point it out.
It all started with tuxracer 0.6.1. The nearly famouse error.
checking whether glx.h defines glXGetProcAddressARB... no
configure: error: Your copy of glx.h is out of date. You can get a more recent copy from the latest Mesa distribution (http://mesa3d.sourceforge.net).
So I checked out Mesa3D installed it. BANG, still detects it as old, so it's gota be linking somewhere wrongly right?
Doing more searching I found that my nVidia installer will install OpenGL headers. So I went to my Mesa-6.2.1 directory and ran:
make realclean
This uninstalled Mesa, I think. I then extracted the nvidia installer and installed it using.
./nvidia-installer --opengl-headers
According to the docs and what info. I can find on the net, this should not only put them in /extracteddir/NVIDIA-Linux-x86-1.0-7174-pkg1/usr/include, but also put them in /usr/include/GL.
OpenGL and GLX header files
(/usr/share/doc/NVIDIA_GLX-1.0/include/GL/gl.h, and
/usr/share/doc/NVIDIA_GLX-1.0/include/GL/glx.h); these files can also
be installed in /usr/include/GL/ by passing the "--opengl-headers"
option to the .run file during installation.
I checked the net for a solution to this and I'm still looking. It's been two or three days now. When I check the links between files I find that some of them don't follow what the Nvidia FAQ says.
It mentions making sure GLX and NV_GLX are present when the "xdpyinfo" is run. They are present when I run it.
They mention stale symlinks that ldconfig should fix. This doesn't work.
It mentions checking the Xorg log and looking for the glx module being loaded. Here is mine:
(II) LoadModule: "glx"
(II) Loading /usr/X11R6/lib/modules/extensions/libglx.so
(II) Module glx: vendor="NVIDIA Corporation"
compiled for 4.0.2, module version = 1.0.7174
Module class: XFree86 Server Extension
ABI class: XFree86 Server Extension, version 0.1
(II) Loading extension GLX
(II) LoadModule: "record"
(II) Loading /usr/X11R6/lib/modules/extensions/librecord.a
(II) Module record: vendor="X.Org Foundation"
compiled for 6.8.1, module version = 1.13.0
Module class: X.Org Server Extension
ABI class: X.Org Server Extension, version 0.2
..............
(II) Loading extension NV-GLX
(II) NVIDIA(0): NVIDIA 3D Acceleration Architecture Initialized
(II) NVIDIA(0): Using the NVIDIA 2D acceleration architecture
(==) NVIDIA(0): Backing store disabled
(==) NVIDIA(0): Silken mouse enabled
(II) Loading extension NV-CONTROL
This is the info that I was looking at when trying to check my symlinks for the headers.
If you think there may be something awry
in your installation, check that the following files are in place
(these are all the files of the NVIDIA Accelerated Linux Driver Set,
plus their symlinks):
I think this is where my problem lies but I don't know where to begin on fixing it. There isn't much detail in the nVidia readme. It just says rename the conflicting lbraries.
Should I just rename/remove all OpenGL libraries and re-install the nVidia installer? I don't see anything like what the readme says.
After MORE forum searching and reading I found a post that says I need to get rid of the default xorg gl(mesa as well?). ^So yes^.
bwkaz
06-04-2005, 05:10 PM
Err, headers are not libraries. ldconfig and playing with stuff in /usr/lib won't help. ;)
realclean also probably won't uninstall Mesa -- that's what "make uninstall" is for. Assuming Mesa supports that, anyway; some packages don't.
After that I try to build code in KDevelope: So... what happens? ;) Other than the glrectf call that should be glRectf, that is. What fails? What's the error message? What command are you using to compile this? (Doesn't kdevelop show you that? It should, if the authors of the tool have a clue. They may not, though.)
acid45
06-04-2005, 08:58 PM
Well I have three things to say.
1 I explain things about as good as a president without cue cards. You're the third person that thought I thought libraries (actual something aka win32 dlls) are headers (api of something). I'm playing with libraries because from what I can find with my nVidia README is that my library symlinks are incorrect. The headers are there and they are the nVidia headers.
bash-3.00# glxinfo
name of display: :0.0
display: :0 screen: 0
direct rendering: Yes
server glx vendor string: NVIDIA Corporation
server glx version string: 1.3
server glx extensions:
GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_SGIX_fbconfig,
GLX_SGIX_pbuffer, GLX_SGI_video_sync, GLX_SGI_swap_control,
GLX_ARB_multisample, GLX_NV_float_buffer
client glx vendor string: NVIDIA Corporation
client glx version string: 1.3
client glx extensions:
GLX_ARB_get_proc_address, GLX_ARB_multisample, GLX_EXT_visual_info,
GLX_EXT_visual_rating, GLX_EXT_import_context, GLX_SGI_video_sync,
GLX_NV_swap_group, GLX_NV_video_out, GLX_SGIX_fbconfig, GLX_SGIX_pbuffer,
GLX_SGI_swap_control, GLX_NV_float_buffer
GLX extensions:
GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_SGIX_fbconfig,
GLX_SGIX_pbuffer, GLX_SGI_video_sync, GLX_SGI_swap_control,
GLX_ARB_multisample, GLX_NV_float_buffer, GLX_ARB_get_proc_address
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: GeForce FX 5200/AGP/SSE/3DNOW!
OpenGL version string: 1.5.3 NVIDIA 71.74
.................................................. ...............................
2 When I compile I get a bunch of undefined reference. I found that sending -lglut as a parameter for gcc will fix my problems, but like I said I'm using KDevelop IDE. I supose it might be a good idea to learn gcc sometimes soon. I figured KDevelop used gcc so I tried finding a place where I can add my own command line options. I didn't get very far. I don't know why tux racer won't install.
When I try to compile tux racer I get the error mentioned in my previous post, the nearly famous one :P
3 There was no make uninstall. There were make clean realclean and install. There was no KEEP section so I figured it would just uninstall it... I figured that's what Mesa people figured as well. My Mesa-6.2.1 Makefile.txt is attached.
P.S. I found the post to add C/C++ and fortran compile options I tried adding the -lglut option to as about as many places I would think it would fit. I found out where it should go I think. I get this message when I put
-lglut in the Project->project options->configure options->c++->compiler command (CXX)
checking whether the -lglut linker (/usr/i486-slackware-linux/bin/ld) supports shared libraries... yes
if I remove it this seems to be replaced by
checking whether the g++ linker (/usr/i486-slackware-linux/bin/ld) supports shared libraries... yes
Either way my program compiles with the same undefined refrence error for every gl glut command call. I fixed that typo BTW thanks :D
I'm gona try compiling it with gcc only tomorow. Right now I'm going to destroy some brain cells.
Thanks for the help :D
Here is where the compile error starts
linking openglpractice (gcc)
/usr/local/src/opengl/openglpractice/src/openglpractice.c:34: undefined reference to `glClearColor'
now where is that :bash-head-on-bash: smiley
bwkaz
06-05-2005, 01:53 PM
Originally posted by acid45
You're the third person that thought I thought libraries (actual something aka win32 dlls) are headers (api of something). Uh.... oh. Well, never mind then. ;)
I'm playing with libraries because from what I can find with my nVidia README is that my library symlinks are incorrect. The headers are there and they are the nVidia headers. OK.
I found that sending -lglut as a parameter for gcc will fix my problems, Yes, if you're using GLUT functions, it helps to link against the glut library. ;)
I figured KDevelop used gcc so I tried finding a place where I can add my own command line options. I didn't get very far. It does use gcc. But I've never used it, so I don't know where you'd add that kind of thing.
I don't know why tux racer won't install. It says the problem is your glx.h header file -- have you tried it again after installing nvidia's headers?
There was no make uninstall. There were make clean realclean and install. There was no KEEP section so I figured it would just uninstall it... I figured that's what Mesa people figured as well. A lot of tarballs don't have an uninstall target. Which is really too bad -- it'd be nice to be able to rely on that.
What I do is just install each package as a separate (non-root) user. All the users are members of an "install" group, which has write permission to the various directories that they install files to. When the packages install their files, the owner ends up being the package name, so I can uninstall anything just by searching my system for files owned by (for example) the "mesa" user.
But of course, this causes a fair number of issues (setuid-root files, for example -- package users won't be able to make them owned by root, so they end up being setuid-package-user, which rarely does any good). I wouldn't recommend doing it.
I get this message when I put
-lglut in the Project->project options->configure options->c++->compiler command (CXX)
Yeah, that's because if you do that, kdevelop thinks the C++ compiler's name should be -lglut (instead of g++), which is not right.
Either way my program compiles with the same undefined refrence error for every gl glut command call.
linking openglpractice (gcc)
.../openglpractice/src/openglpractice.c:34: undefined reference to `glClearColor' glClearColor should be defined in /usr/lib/libGL.so, but my libGL.so has "no symbols" according to nm... that's not right...
Well, readelf -s shows it there, though, so that's probably good enough.
acid45
06-06-2005, 08:34 PM
Yes, if you're using GLUT functions, it helps to link against the glut library.
I figured #include <GL/glut.h> would include and link it. I guess I have to figure out how to link it in KDevelop then...or forget kdevelop and learn gcc. I think when I get back into my system I'll start on gcc, seems simpler.
I don't know why tux racer won't install.
It says the problem is your glx.h header file -- have you tried it again after installing nvidia's headers?
I have tried after installing but I haven't tried since I installed them again and making sure they're there.
I haven't looked into the problem anymore sionce I locked myself out last night. I was trying to get F@H to run in the rc.local init script and forgot to add the ampersand(&) at the end of the call so it goes right into F@H and won't allow me to change to another tty, it doesn't load the shell I don't think.
I'm trying to figure out how to get lilo to boot with the option shell=/bin/sh. bypassing the init scripts...
I tried
_________________________
lilo box with basic boot options|
---------------------------------------|
boot:slackware shell=/bin/sh
I'll let you know how I end up when I get back into my system :rolleyes:
[edit]
Well I'm not locked out anymore. I found another solution saying the same as ther oter I found but instead of shell=/bin/sh it was init=/bin/sh
I tried compiling tux again and still I get the same error
checking whether glx.h defines glXGetProcAddressARB... no
configure: error: Your copy of glx.h is out of date. You can get a more recent copy from the latest Mesa distribution (http://mesa3d.sourceforge.net).
I'm not too worried about tux racer but I'm sure if I solve this problem for tux t will allow me to continue pramming with opengl too. I think it's the same issue.
I'm looking into ldd and ldconfig so I can get my links proper, as well as what libraries could be distracting the linker.
Thanks for your help!
acid45
06-06-2005, 09:19 PM
Here is an excerpt from my README.
Problems will arise if applications use the wrong version of a library.
This can be the case if there are either old libGL libraries or stale
symlinks left lying around. If you think there may be something awry
in your installation, check that the following files are in place
(these are all the files of the NVIDIA Accelerated Linux Driver Set,
plus their symlinks):
I looked for the files, "/usr/X11R6/lib/libGL.so*" and "/usr/X11R6/lib/libGLcore.so*", that "often create conflits" but I didn't find them. I did fid the files
/usr/X11R6/lib/libGLU.so*
/usr/X11R6/lib/libGLw.so*
and
/usr/X11R6/lib/libOSMesa.so*
/usr/X11R6/lib/modules/drivers/nvidia_drv.o and /lib/modules/`uname -r`/kernel/drivers/video/nvidia.o both exist.
I tried renaming /usr/lib/libGLcore.so.1 so that it would fix likns if that were the conflicting library,
acid45
06-07-2005, 01:09 PM
I think I found half of something. I found a tutorial on using SDL, not glut. It requires the same linking as prety much anything needs. I remembered having to link everything in Visual Studio 6, and the mention of linking it to the project up above triggered a work trail for me.
The problem I have now is. In the tutorial for an older KDevelop I found that there used to be a section for linker options. They were located at:
Project->Project Options->Linker Options
I checked the entire Project menu and I can't find a "Linker Options" screen anywhere. I figured it must have been changed. I went to the KDevelop site and tried to find newer documentation that might mention the location of these linker options but I found that most of the documentation for the 3.1.x series -- mine is 3.1.2 -- still has the message "to be written."
If I don't find anything on this soon I'm going to drop KDevelop altogether and work on getting OpenBSD installed and learn to use GCC in that.
P.S.
I have been offered a job to work on a set of servers running web and mail software using the OpenBSD system. I found that since I use Slackware I am in for a treat, a lot of what slackware has is more unix like, as is Open/FreeBSD systems. I am figuring the install will be the most complicated process.
Reading the docs on OpenBSD I found that instead of looking for an ISO like I usualy do I will probably have to create an install disc on my own using packages on the site. From what it seems to me I would prety much just get the packages I want, put them on a CD with a bootdisk image, cd37.iso, and then install away. I can also try and use the FTP option but I'd rather play with the CD and packaging of the system rather than having it automated for me.
Using this method I will have my bootdisc and instalation media al on the same disk.
I'm also looking into speeding up my host lookup times. I tried adding a search line to my /etc/resolv.conf. Linux is so much fun. So much to learn so little time. I'm afraid if I do netconfig, which I think will do the trick, giving me a hostname rather than the default, which will let me look up hosts faster.
Mystery solved:
The difference between disk and disc...
...
the cost to print
bwkaz
06-07-2005, 07:45 PM
Originally posted by acid45
I figured #include <GL/glut.h> would include and link it. It will include it. It will NOT link it. That's what I was saying before, with "headers are not libraries". ;)
I found another solution saying the same as ther oter I found but instead of shell=/bin/sh it was init=/bin/sh Yep, that's right.
I'm not too worried about tux racer but I'm sure if I solve this problem for tux t will allow me to continue pramming with opengl too. I think it's the same issue. It's a bug in tuxracer's configure script and nvidia's glxext.h header, actually.
You need to add -DGLX_GLXEXT_PROTOTYPES to your CPPFLAGS before you run configure. ;)
Originally posted by acid45
Here is what I get from the first one. This looks wrong to me but I don't know how to fix it. It doesn't matter. You don't link against the libglx.so library at all (that's only there as a driver for X). ;)
I looked for the files, "/usr/X11R6/lib/libGL.so*" and "/usr/X11R6/lib/libGLcore.so*", that "often create conflits" but I didn't find them. I did fid the files
/usr/X11R6/lib/libGLU.so*
/usr/X11R6/lib/libGLw.so*
and
/usr/X11R6/lib/libOSMesa.so*
Could these be causing problems? Not likely.
This is what I get when I check the links That's exactly what I get, and it works here. (Again, libglx isn't the problem, but libGL looks OK too.)
/usr/X11R6/lib/modules/drivers/nvidia_drv.o and /lib/modules/`uname -r`/kernel/drivers/video/nvidia.o both exist. Neither of which should be affecting non-X, non-kernel code. ;)
I tried renaming /usr/lib/libGLcore.so.1 so that it would fix likns if that were the conflicting library, It's not. It's part of nvidia's drivers, and needs to be in the list.
Originally posted by acid45
I went to the KDevelop site and tried to find newer documentation that might mention the location of these linker options but I found that most of the documentation for the 3.1.x series -- mine is 3.1.2 -- still has the message "to be written." I hate it when that happens. :(
If I don't find anything on this soon I'm going to drop KDevelop altogether and work on getting OpenBSD installed and learn to use GCC in that. No need to move to OpenBSD to try gcc -- just try to compile it. Get into the directory your .c file is in, and do a:
and see if that works. (If it actually uses C++ stuff, then you'll have to use g++, but the sample you provided earlier does not use C++.)
acid45
06-07-2005, 10:20 PM
Yeah that worked...thanks. :babyspoon:
bwkaz
06-08-2005, 06:21 PM
:babyspoon: ? ;)
Anyway, OK, if the test with gcc worked, then your libraries are installed correctly. The only remaining issue is how to specify extra libraries (and perhaps paths) to pass to the linker from kdevelop -- and I have no idea on that one, having never been able to actually get kdevelop installed. (I always chicken out after finding, or remembering, that it requires htdig. For one, the license on htdig is confusing. For two, it almost sounds like you have to have a web server installed for it to work. Not worth the trouble, IMO.)
justlinux.com
Copyright Internet.com Inc. All Rights Reserved.