Build error: undefined reference to symbol 'XInternAtom'

Issue #439 closed
Former user created an issue

Originally reported on Google Code with ID 439

Hi, I get an error when compiling (full log attached):

[ 56%] Building CXX object CMakeFiles/speedcrunch.dir/qrc_speedcrunch.o           

Linking CXX executable speedcrunch
/usr/bin/ld: CMakeFiles/speedcrunch.dir/gui/mainwindow.o: undefined reference to symbol
'XInternAtom'
/usr/bin/ld: note: 'XInternAtom' is defined in DSO /usr/lib/libX11.so.6 so try adding
it to the linker command line
/usr/lib/libX11.so.6: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status
make[2]: *** [speedcrunch] Error 1
make[1]: *** [CMakeFiles/speedcrunch.dir/all] Error 2
make: *** [all] Error 2

It builds fine with:
sed -e 's|(${PROGNAME} ${QT_LIBRARIES})|(${PROGNAME} ${QT_LIBRARIES} X11)|' -i CMakeLists.txt

Product version:
master branch
c8b8f7100218cd7590dbf892c5a3912e7c5929fa

Operating system:
Arch Linux
Qt 4.8.4

Reported by goetzchrist on 2013-03-29 23:11:41

Comments (8)

  1. Former user Account Deleted
    That's strange. By linking with QtGui, libX11 should be available. Can you please try
    applying this patch from GitHub branch "x11" and tell me whether it works for you?
    https://github.com/speedcrunch/SpeedCrunch/commit/f57628867dcf96c51ad0f81832ce9904569bf93b
    

    Reported by helder.pereira.correia on 2013-03-30 02:20:54

  2. Former user Account Deleted
    With the patch applied it complies without errors :)
    

    Reported by goetzchrist on 2013-03-30 05:29:10

  3. Former user Account Deleted
    Nice. Could you please check if you can build fine using QMake instead of CMake to see
    if I need to patch it too?
    

    Reported by helder.pereira.correia on 2013-03-31 08:31:37

  4. Former user Account Deleted
    With qmake I get the same linking error.
    

    Reported by goetzchrist on 2013-03-31 16:32:32

  5. Former user Account Deleted
    Fixed in revision d89384c5fee2.
    

    Reported by helder.pereira.correia on 2013-04-07 21:23:19 - Status changed: Fixed - Labels added: Type-Defect, Priority-High, Milestone-0.11, OpSys-Linux

  6. Log in to comment