Cannot compile: missing X11 library

Bug #908789 reported by ufa on 2011-12-26
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fix Released

Bug Description

I am trying to compile Wargus (latest version, from 24/11, 2.2.6, both stratagus and wargus) on Fedora 16, but it gave me errors, after the "cmake .."

$ make
Scanning dependencies of target pudconvert
[ 14%] Building C object CMakeFiles/pudconvert.dir/pud.c.o
[ 28%] Building C object CMakeFiles/pudconvert.dir/pudconvert.c.o
Linking C executable pudconvert
[ 28%] Built target pudconvert
Scanning dependencies of target wargus
[ 42%] Building C object CMakeFiles/wargus.dir/wargus.c.o
Linking C executable wargus
/usr/bin/ld: CMakeFiles/wargus.dir/wargus.c.o: undefined reference to symbol 'XOpenDisplay'
/usr/bin/ld: note: 'XOpenDisplay' is defined in DSO /usr/lib64/ so try adding it to the linker command line
/usr/lib64/ could not read symbols: Invalid operation
collect2: ld returned 1 exit status
make[2]: ** [wargus] Erro 1
make[1]: ** [CMakeFiles/wargus.dir/all] Erro 2
make: ** [all] Erro 2

Is there anything I can do? My libX11:

$ rpm -qa | grep libX11

Related branches

ufa (ufa-ogros) wrote :

I put cmake on debug mode, so it showed me the line where the error occurred:

/usr/lib64/ccache/gcc CMakeFiles/wargus.dir/wargus.c.o -o wargus -rdynamic -lfreetype -lglib-2.0 -lgobject-2.0 -lgdk_pixbuf-2.0 -lgdk-x11-2.0 -lgtk-x11-2.0 -lcairo -lpango-1.0 -latk-1.0

Adding -lX11 solved the issue:

/usr/lib64/ccache/gcc CMakeFiles/wargus.dir/wargus.c.o -o wargus -rdynamic -lfreetype -lglib-2.0 -lgobject-2.0 -lgdk_pixbuf-2.0 -lgdk-x11-2.0 -lgtk-x11-2.0 -lcairo -lpango-1.0 -latk-1.0 -lX11

Pali (pali) wrote :

Ok, in CMakeLists.txt is missing "find_package(X11)". You have propably old/new/other version of CMake of CMake scripts as me and it not automatically added X11 library as dependecy. I will fix it in bzr.

Changed in wargus:
importance: Undecided → Medium
status: New → In Progress
assignee: nobody → Pali (pali)
Pali (pali) on 2011-12-26
summary: - Cannot compile it on Fedora 16
+ Cannot compile: missing X11 library
Changed in wargus:
status: In Progress → Fix Committed
Pali (pali) on 2012-04-19
Changed in wargus:
milestone: none → 2.2.7
Pali (pali) on 2012-08-20
Changed in wargus:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers