Linker problems with code from "Learning Modern 3D Graphics Programming" tutorial

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.

[QUOTE=norm_in_tx;1252473]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?[/QUOTE]

A websearch suggests your Debian is probably hosed:

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.

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.

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: GitHub - rsanchezsaez/gltut-glfw: Xcode + GLFW 3 adaptation of the Learning Modern 3D Graphics Programming (http://www.arcsynthesis.org/gltut/) tutorials.

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!

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.