#69 cannot compile:missing libX11.so

open
nobody
None
5
2009-02-05
2009-02-05
Markus Leuthold
No

this is my link error

Linking CXX shared module ../lib/libkplayerpart.so
CMakeFiles/kplayerpart.dir/x11.o: In function
`KPlayerX11UnmapWindow(unsigned int)':
x11.cpp:(.text+0xe): undefined reference to `XUnmapWindow'
CMakeFiles/kplayerpart.dir/x11.o: In function
`KPlayerX11MapWindow(unsigned int)':
x11.cpp:(.text+0x2e): undefined reference to `XMapWindow'
CMakeFiles/kplayerpart.dir/x11.o: In function
`KPlayerX11SetInputFocus(unsigned int)':
x11.cpp:(.text+0x6a): undefined reference to `XSetInputFocus'
CMakeFiles/kplayerpart.dir/x11.o: In function
`KPlayerProcessX11Event(_XEvent*)':
x11.cpp:(.text+0x1cd): undefined reference to `XGetAtomName'
x11.cpp:(.text+0x1f4): undefined reference to `XFree'
CMakeFiles/kplayerpart.dir/x11.o: In function
`KPlayerX11GetKeyboardMouseState(unsigned int)':
x11.cpp:(.text+0x273): undefined reference to `XQueryPointer'
CMakeFiles/kplayerpart.dir/x11.o: In function
`KPlayerX11UnmapWindow(unsigned int)':
x11.cpp:(.text+0x1c): undefined reference to `XFlush'
CMakeFiles/kplayerpart.dir/x11.o: In function
`KPlayerX11MapWindow(unsigned int)':
x11.cpp:(.text+0x3c): undefined reference to `XFlush'
CMakeFiles/kplayerpart.dir/x11.o: In function
`KPlayerX11SetInputFocus(unsigned int)':
x11.cpp:(.text+0x85): undefined reference to `XFlush'
collect2: ld returned 1 exit status
make[2]: *** [lib/libkplayerpart.so] Error 1
make[1]: *** [kplayer/CMakeFiles/kplayerpart.dir/all] Error 2
make: *** [all] Error 2

I can fix it by adding
target_link_libraries(kplayerpart .... "/usr/lib64/libX11.so") to CMakeLists.txt

/usr/lib/ links to /usr/lib64. I'm using Gentoo

you're not the only one with this issue:
http://article.gmane.org/gmane.comp.kde.digikam.devel/23533

Discussion