paroj / gltut

Learning Modern 3D Graphics Programming
https://paroj.github.io/gltut/
MIT License
1.57k stars 377 forks source link

Problem linking tutorials with X11 (undefined reference to symbol 'XSendEvent') #66

Closed paroj closed 8 years ago

paroj commented 11 years ago

Originally reported by: Anonymous


I'm using Slackware Linux and GNU make. When attempting to link a tutorial I get this:

#!log
==== Building Tut 08 Gimbal Lock (debug) ====
GimbalLock.cpp
Linking Tut 08 Gimbal Lock
/usr/lib64/gcc/x86_64-slackware-linux/4.7.1/../../../../x86_64-slackware-linux/bin/ld: ../glsdk/freeglut/lib/libfreeglutD.a(freeglut_window.o): undefined reference to symbol 'XSendEvent'
/usr/lib64/gcc/x86_64-slackware-linux/4.7.1/../../../../x86_64-slackware-linux/bin/ld: note: 'XSendEvent' is defined in DSO /usr/lib64/libX11.so.6 so try adding it to the linker command line
/usr/lib64/libX11.so.6: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status
make[1]: *** [Tut 08 Gimbal LockD] Error 1
make: *** [Tut 08 Gimbal Lock] Error 2

I need to add the flag -lX11 in order to link properly. Adding "X11" to framework.lua should do the trick:

#!lua
        configuration "linux"
            links {"GL", "GLU", "X11"}

Building a glsdk example, like simple_glut, also has this problem.


paroj commented 10 years ago

Original comment by Timothy Arceri (Bitbucket: tarceri, GitHub: tarceri):


Is a new version of the Tutorials going to be released soon? I was about to give up on this book before I even started until I stumbled across this bug.

Also please include the fix for this bug in the new release too: #94/error-building-tut-12-and-16

paroj commented 11 years ago

Original comment by Jason McKesson (Bitbucket: alfonse, GitHub: alfonse):


This fix is in changelist f5764a74b37e. It will be in the next version of the tutorials.