polybar: Install Error: XCB
Hey y’all,
I’m toying around with forces beyond my mortal comprehension in installing Polybar. I’m running Mint 18 on Cinnamon. The CMake works (after following the tips in this issue), but the install chokes on a chunk of XCB code.
A little Googling tells me that I need to compile Cairo differently, but I’m not sure how to pull that off using a package manager. Tips?
CMake:
>cmake ..
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- No build type specified; using RelWithDebInfo
-- Using supported compiler GNU-5.4.0
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1")
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Found Threads: TRUE
-- Checking for module 'cairo-fc'
-- Found cairo-fc, version 1.14.6
-- Found Libiw: /usr/lib/x86_64-linux-gnu/libiw.so
-- Checking for module 'xcb-xkb'
-- Found xcb-xkb, version 1.11.1
-- Checking for module 'xcb-randr'
-- Found xcb-randr, version 1.11.1
-- Build:
-- Type: RelWithDebInfo
-- CC: /usr/bin/cc -O2 -g -DNDEBUG
-- CXX: /usr/bin/c++ -Wall -Wextra -Werror -O2 -pedantic -pedantic-errors -O2 -g -DNDEBUG
-- LD: /usr/bin/ld
-- Targets:
-- polybar-msg
-- testsuite
-- Module support:
-- alsa
-- curl
-- i3
-- mpd
-- network
-- X extensions:
-- xcb-randr
-- xcb-randr (monitor support)
-- xcb-render
-- xcb-damage
-- xcb-sync
-- xcb-composite
-- xcb-xkb
-- xcb-xrm
-- Found font: fixed:pixelsize=10
-- Font not found: unifont:fontformat=truetype
-- Font not found: siji:pixelsize=10
-- Checking for module 'xcb-proto'
-- Found xcb-proto, version 1.11
-- Found PythonInterp: /home/roy/anaconda2/bin/python2.7 (found suitable version "2.7.13", minimum required is "2.7")
-- XCB[XCB]: Found component XCB
-- Found XCB_XCB: /home/roy/anaconda3/lib/libxcb.so
-- XCB[ICCCM]: Found component ICCCM
-- Found XCB_ICCCM: /usr/lib/x86_64-linux-gnu/libxcb-icccm.so
-- XCB[EWMH]: Found component EWMH
-- Found XCB_EWMH: /usr/lib/x86_64-linux-gnu/libxcb-ewmh.so
-- XCB[UTIL]: Found component UTIL
-- Found XCB_UTIL: /usr/lib/x86_64-linux-gnu/libxcb-util.so
-- XCB[IMAGE]: Found component IMAGE
-- Found XCB_IMAGE: /usr/lib/x86_64-linux-gnu/libxcb-image.so
-- Found XCB: /home/roy/anaconda3/lib/libxcb.so;/usr/lib/x86_64-linux-gnu/libxcb-icccm.so;/usr/lib/x86_64-linux-gnu/libxcb-ewmh.so;/usr/lib/x86_64-linux-gnu/libxcb-util.so;/usr/lib/x86_64-linux-gnu/libxcb-image.so
-- XCB[RANDR]: Found component RANDR
-- Found XCB_RANDR: /home/roy/anaconda3/lib/libxcb-randr.so
-- Found XCB: /home/roy/anaconda3/lib/libxcb.so;/usr/lib/x86_64-linux-gnu/libxcb-icccm.so;/usr/lib/x86_64-linux-gnu/libxcb-ewmh.so;/usr/lib/x86_64-linux-gnu/libxcb-util.so;/usr/lib/x86_64-linux-gnu/libxcb-image.so;/home/roy/anaconda3/lib/libxcb-randr.so
-- XCB[XKB]: Found component XKB
-- Found XCB_XKB: /home/roy/anaconda3/lib/libxcb-xkb.so
-- Found XCB: /home/roy/anaconda3/lib/libxcb.so;/usr/lib/x86_64-linux-gnu/libxcb-icccm.so;/usr/lib/x86_64-linux-gnu/libxcb-ewmh.so;/usr/lib/x86_64-linux-gnu/libxcb-util.so;/usr/lib/x86_64-linux-gnu/libxcb-image.so;/home/roy/anaconda3/lib/libxcb-randr.so;/home/roy/anaconda3/lib/libxcb-xkb.so
-- xpp: including xcb proto xproto.xml
-- xpp: including xcb proto randr.xml
-- xpp: including xcb proto xkb.xml
-- Checking for module 'jsoncpp>=1.7.7'
--
-- Could not find jsoncpp>=1.7.7 -- building static lib...
-- JsonCpp Version: 1.7.7
-- Found PythonInterp: /home/roy/anaconda2/bin/python2.7 (found suitable version "2.7.13", minimum required is "2.6")
-- Configuring done
-- Generating done
-- Build files have been written to: /home/roy/vcs/polybar/build
Install:
>sudo make install
Scanning dependencies of target xpp
[ 1%] Linking CXX static library libxpp.a
list: size, ['red', 'green', 'blue']
list: size, ['red', 'green', 'blue']
[ 1%] Built target xpp
Scanning dependencies of target jsoncpp_lib_static
[ 2%] Building CXX object lib/i3ipcpp/libs/jsoncpp-1.7.7/src/lib_json/CMakeFiles/jsoncpp_lib_static.dir/json_reader.cpp.o
[ 3%] Building CXX object lib/i3ipcpp/libs/jsoncpp-1.7.7/src/lib_json/CMakeFiles/jsoncpp_lib_static.dir/json_value.cpp.o
[ 4%] Building CXX object lib/i3ipcpp/libs/jsoncpp-1.7.7/src/lib_json/CMakeFiles/jsoncpp_lib_static.dir/json_writer.cpp.o
[ 5%] Linking CXX static library libjsoncpp.a
[ 5%] Built target jsoncpp_lib_static
Scanning dependencies of target i3ipc++
[ 5%] Building CXX object lib/i3ipcpp/CMakeFiles/i3ipc++.dir/src/ipc.cpp.o
[ 7%] Building CXX object lib/i3ipcpp/CMakeFiles/i3ipc++.dir/src/ipc-util.cpp.o
[ 8%] Linking CXX static library libi3ipc++.a
[ 8%] Built target i3ipc++
Scanning dependencies of target polybar
[ 9%] Building CXX object bin/CMakeFiles/polybar.dir/components/config.cpp.o
[ 10%] Building CXX object bin/CMakeFiles/polybar.dir/components/builder.cpp.o
[ 11%] Building CXX object bin/CMakeFiles/polybar.dir/components/command_line.cpp.o
[ 12%] Building CXX object bin/CMakeFiles/polybar.dir/components/controller.cpp.o
[ 14%] Building CXX object bin/CMakeFiles/polybar.dir/components/taskqueue.cpp.o
[ 15%] Building CXX object bin/CMakeFiles/polybar.dir/components/screen.cpp.o
[ 16%] Building CXX object bin/CMakeFiles/polybar.dir/components/parser.cpp.o
[ 17%] Building CXX object bin/CMakeFiles/polybar.dir/components/ipc.cpp.o
[ 18%] Building CXX object bin/CMakeFiles/polybar.dir/components/bar.cpp.o
[ 20%] Building CXX object bin/CMakeFiles/polybar.dir/components/renderer.cpp.o
In file included from /home/roy/vcs/polybar/include/cairo/context.hpp:3:0,
from /home/roy/vcs/polybar/src/components/renderer.cpp:2:
/usr/include/cairo/cairo-xcb.h:113:3: **error: #error Cairo was not compiled with support for the xcb backend**
# error Cairo was not compiled with support for the xcb backend
^
In file included from /home/roy/vcs/polybar/include/cairo/context.hpp:9:0,
from /home/roy/vcs/polybar/src/components/renderer.cpp:2:
/home/roy/vcs/polybar/include/cairo/surface.hpp: In constructor ‘polybar::v3_0_5_git::cairo::xcb_surface::xcb_surface(xcb_connection_t*, xcb_pixmap_t, xcb_visualtype_t*, int, int)’:
/home/roy/vcs/polybar/include/cairo/surface.hpp:65:57: error: ‘cairo_xcb_surface_create’ was not declared in this scope
: surface(cairo_xcb_surface_create(c, p, v, w, h)) {}
^
/home/roy/vcs/polybar/include/cairo/surface.hpp: In member function ‘void polybar::v3_0_5_git::cairo::xcb_surface::set_drawable(xcb_drawable_t, int, int)’:
/home/roy/vcs/polybar/include/cairo/surface.hpp:71:50: error: ‘cairo_xcb_surface_set_drawable’ was not declared in this scope
cairo_xcb_surface_set_drawable(m_s, d, w, h);
^
bin/CMakeFiles/polybar.dir/build.make:278: recipe for target 'bin/CMakeFiles/polybar.dir/components/renderer.cpp.o' failed
make[2]: *** [bin/CMakeFiles/polybar.dir/components/renderer.cpp.o] Error 1
CMakeFiles/Makefile2:798: recipe for target 'bin/CMakeFiles/polybar.dir/all' failed
make[1]: *** [bin/CMakeFiles/polybar.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 1
- Comments: 16 (8 by maintainers)
After some testing I have determined that on some setups it’s virtually impossible to build polybar if anaconda is lingering in the
PATH, I have rewritten the entry on the known issues page for instructions on how to build polybar without anaconda getting in the way: https://github.com/jaagr/polybar/wiki/Known-Issues#building-with-anaconda-installedIt seems as though you have some libraries installed inside your home directory and those libraries are being prefered over the system libraries.
Look at this diff. The right side is your cmake output when you ran
sudo ./build.shand the left side is without sudo.The libraries are in the
anaconda3folder and I’m assuming that it is from this. For some reason the libraries installed with anaconda either are not compiled with the right flags or are outdated. If you do not use anaconda then removing that folder should solve this problem. If however, you do rely on anaconda for something I don’t see another way than to run the build as root (or another user that does not have the anaconda libraries), as I don’t know how to force polybar (actually it’s the xpp library) to prefer one library over another.it doesn’t work without sudo:
Also clang is not installed: