Help building/running SDL/OpenGL code
Richard Mace
macerl at telkomsa.net
Tue Dec 22 15:36:47 UTC 2009
I developed a small molecular dynamics simulation under Linux some time ago.
Since recently moving to FreeBSD I thought that I'd try to get it running
here, too.
However, although I am able to get the code to build, it dumps core --
apparently before getting to any user code! During the build (linking phase) I
get one error which seems to be a pointer to the source of the problem:
=============================================
gcc -Wall -L/usr/local/lib -o lennardjones main.o anim-thread.o ode.o
gasdynamics.o eyedynamics.o -lSDL -lSDL_gfx -lm -lGLU
/usr/bin/ld: warning: libm.so.3, needed by /usr/local/lib/libGL.so.1, may
conflict with libm.so.5
=============================================
Note the last two lines. (I have included the two previous lines to show the
dependent libraries, if that helps.)
Important information:
1) I am running the code on an i386 machine with the NVIDIA driver (nvidia-
driver-173 for an old FX 5200).
2) I installed the Mesa Libs after installing the NVIDIA driver. I then
thought this might produce a conflict with the Nvidia-supplied GL libs, so un-
installed the NVIDIA driver. Then re-installed after installing mesa-demos.
3) "glxinfo | grep -i render" reports:
direct rendering: Yes
OpenGL renderer string: GeForce FX 5200/PCI/SSE2
4) glxgears runs without problems
When I uninstall the NVIDIA driver and build the code, the linker error above
disappears and the code runs to the point where I can select the graphics
mode, i.e., it executes user code without dumping core. However, selecting any
mode now gives (somewhat expectedly):
===========================================
selected video mode is: 1280 x 1024 (32 bpp)
Could not set video mode: Couldn't find matching GLX visual
===========================================
So, it appears that there is some conflict between the mesa libraries (which I
need to #include to build the code) and the NVIDIA-supplied libraries, or am I
on the wrong track?
Can anyone shed some light on this? I've spent quite some time on what first
appeared to be a fairly trivial task and I am eager to see how this runs under
FreeBSD.
Thanks in advance...
-Richard
More information about the freebsd-questions
mailing list