PDA

View Full Version : Linker problems with code from "Learning Modern 3D Graphics Programming" tutorial



norm_in_tx
07-06-2013, 11:17 AM
When trying to compile the example code from the above tutorial on a Debian Sid box, I get the following linker error:

==== Building framework (release) ====
==== Building Tut 01 Main (release) ====
Creating obj/Release
tut1.cpp
Linking Tut 01 Main
/usr/bin/ld: ../glsdk/freeglut/lib/libfreeglut.a(freeglut_window.o): undefined reference to symbol 'XGetWindowAttributes'
/usr/lib/x86_64-linux-gnu/libX11.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

In an attempt to correct the problem I added "-lX11" to "LIBS +=" in the make file. The code then links without error but I get the following run time error:


~/Tutorial 0.3.8/Tut 01 Hello Triangle$ ./Tut\ 01\ Main
Inconsistency detected by ld.so: dl-version.c: 224: _dl_check_map_versions: Assertion `needed != ((void *)0)' failed!


Any advice on how to solve this?

Thanks in advance.

Dark Photon
07-06-2013, 07:50 PM
When trying to compile the example code from the above tutorial on a Debian Sid box, ...I get the following run time error:


~/Tutorial 0.3.8/Tut 01 Hello Triangle$ ./Tut\ 01\ Main
Inconsistency detected by ld.so: dl-version.c: 224: _dl_check_map_versions: Assertion `needed != ((void *)0)' failed!


Any advice on how to solve this?

A websearch suggests your Debian is probably hosed:

* http://www.unrealadmin.org/forums/showthread.php?t=31057

GClements
07-06-2013, 11:10 PM
/usr/bin/ld: ../glsdk/freeglut/lib/libfreeglut.a(freeglut_window.o): undefined reference to symbol 'XGetWindowAttributes'


There should be an official freeglut package for whichever version of Debian you're using. Install it, and modify the Makefiles to use that instead of the version in ../glsdk.

norm_in_tx
07-07-2013, 10:37 AM
Thanks for the replies!

Dark Photon - I update this unstable install a couple of times per week so I don't know whether the problem is the due to a package in transition or my install being broken. I was able to compile the code successfully in Debian testing on another partition on the same machine.

GClements - I have dabbled with OpenGL in Qt using QGLWidget so the freeglut packages are installed. The tutorial is based on the Unofficial OpenGl SDK so getting the code to compile with Debian's package will involve more than just modifying the Makefiles. Probably more effort than I want to put into it.

Edit: As a noob the site wouldn't let me post a link to the Unofficial OpenGL SDK page.

rsanchezsaez
09-01-2013, 02:47 PM
I started a GLFW3 port of these tutorials, as I find FreeGLUT outdated and was unable to make it run on OS X.

I'm working on the OS X part here: https://github.com/rsanchezsaez/gltut-glfw

I'm only providing an Xcode project (works straight away on OS X), but the code should be pretty much cross-platform and a Makefile should not be difficult to write. If anybody wants to make sure it build on Linux and contribute build files I'll merge the changes.

Cheers!