When I configure Qt 5.6, it shows that xcb failed! Why?
-
When I configured Qt 5.6 source code using Ubuntu 12.04 lts, I came across this problem:
"xcb auto-detection... ()
arm-linux-g++ -lts -c -pipe -O2 -Wall -W -fPIC -I. -I../../../mkspecs/linux-arm-gnueabi-g++ -o xcb.o xcb.cpp
xcb.cpp:34: fatal error: xcb/xcb.h: No such file or directory
compilation terminated.
make: *** [xcb.o] Error 1
xcb disabled.
The test for linking against libxcb failed!
You might need to install dependency packages for libxcb.
See src/plugins/platforms/xcb/README.
"
However, the packages are all installed. Could anyone help me? Thanks in advance! -
Hi,
Are they installed for your target ?
-
@small_bird Are you really sure xcb is installed for your target (not for Ubuntu host machine)?
This error tells you that xcb header file could not be found, so at least the xcb-dev package is not installed:xcb.cpp:34: fatal error: xcb/xcb.h: No such file or directory
-
@jsulm Yes the xcb is installed for my target.
root@ubuntu:/opt/qt-everywhere-opensource-src-5.6.0# dpkg -l|grep xcb
ii libx11-xcb-dev 2:1.6.3-1ubuntu2 Xlib/XCB interface library (development headers)
ii libx11-xcb1 2:1.6.3-1ubuntu2 Xlib/XCB interface library
ii libx11-xcb1-dbg 2:1.6.3-1ubuntu2 Xlib/XCB interface library (debug package)
ii libxcb-composite0 1.11.1-1ubuntu1 X C Binding, composite extension
ii libxcb-composite0-dbg 1.11.1-1ubuntu1 X C Binding, composite extension, debugging symbols
ii libxcb-composite0-dev 1.11.1-1ubuntu1 X C Binding, composite extension, development files
ii libxcb-cursor-dev 0.1.1-3ubuntu1 utility libraries for X C Binding -- cursor, development files
ii libxcb-cursor0 0.1.1-3ubuntu1 utility libraries for X C Binding -- cursor
ii libxcb-damage0 1.11.1-1ubuntu1 X C Binding, damage extension
ii libxcb-damage0-dbg 1.11.1-1ubuntu1 X C Binding, damage extension, debugging symbols
ii libxcb-damage0-dev 1.11.1-1ubuntu1 X C Binding, damage extension, development files
ii libxcb-doc 1.11.1-1ubuntu1 X C Binding, development documentation
ii libxcb-dpms0 1.11.1-1ubuntu1 X C Binding, dpms extension
ii libxcb-dpms0-dbg 1.11.1-1ubuntu1 X C Binding, dpms extension, debugging symbols
ii libxcb-dpms0-dev 1.11.1-1ubuntu1 X C Binding, dpms extension, development files
ii libxcb-dri2-0 1.11.1-1ubuntu1 X C Binding, dri2 extension
ii libxcb-dri2-0-dbg 1.11.1-1ubuntu1 X C Binding, dri2 extension, debugging symbols
ii libxcb-dri2-0-dev 1.11.1-1ubuntu1 X C Binding, dri2 extension, development files
ii libxcb-dri3-0 1.11.1-1ubuntu1 X C Binding, dri3 extension
ii libxcb-dri3-0-dbg 1.11.1-1ubuntu1 X C Binding, dri3 extension, debugging symbols
ii libxcb-dri3-dev 1.11.1-1ubuntu1 X C Binding, dri3 extension, development files
ii libxcb-ewmh-dev 0.4.1-1ubuntu1 utility libraries for X C Binding -- ewmh, development files
ii libxcb-ewmh1 0.3.8-1build1 utility libraries for X C Binding -- ewmh
ii libxcb-ewmh2 0.4.1-1ubuntu1 utility libraries for X C Binding -- ewmh
ii libxcb-glx0 1.11.1-1ubuntu1 X C Binding, glx extension
ii libxcb-glx0-dbg 1.11.1-1ubuntu1 X C Binding, glx extension, debugging symbols
ii libxcb-glx0-dev 1.11.1-1ubuntu1 X C Binding, glx extension, development files
ii libxcb-icccm4 0.4.1-1ubuntu1 utility libraries for X C Binding -- icccm
ii libxcb-icccm4-dev 0.4.1-1ubuntu1 utility libraries for X C Binding -- icccm, development files
ii libxcb-image0 0.4.0-1build1 utility libraries for X C Binding -- image
ii libxcb-image0-dev 0.4.0-1build1 utility libraries for X C Binding -- image, development files
ii libxcb-keysyms1 0.4.0-1 utility libraries for X C Binding -- keysyms
ii libxcb-keysyms1-dev 0.4.0-1 utility libraries for X C Binding -- keysyms, development files
ii libxcb-present-dev 1.11.1-1ubuntu1 X C Binding, present extension, development files
ii libxcb-present0 1.11.1-1ubuntu1 X C Binding, present extension
ii libxcb-present0-dbg 1.11.1-1ubuntu1 X C Binding, present extension, debugging symbols
ii libxcb-randr0 1.11.1-1ubuntu1 X C Binding, randr extension
ii libxcb-randr0-dbg 1.11.1-1ubuntu1 X C Binding, randr extension, debugging symbols
ii libxcb-randr0-dev 1.11.1-1ubuntu1 X C Binding, randr extension, development files
ii libxcb-record0 1.11.1-1ubuntu1 X C Binding, record extension
ii libxcb-record0-dbg 1.11.1-1ubuntu1 X C Binding, record extension, debugging symbols
ii libxcb-record0-dev 1.11.1-1ubuntu1 X C Binding, record extension, development files
ii libxcb-render-util0 0.3.9-1 utility libraries for X C Binding -- render-util
ii libxcb-render-util0-dev 0.3.9-1 utility libraries for X C Binding -- render-util
ii libxcb-render0 1.11.1-1ubuntu1 X C Binding, render extension
ii libxcb-render0-dbg 1.11.1-1ubuntu1 X C Binding, render extension, debugging symbols
ii libxcb-render0-dev 1.11.1-1ubuntu1 X C Binding, render extension, development files
ii libxcb-res0 1.11.1-1ubuntu1 X C Binding, res extension
ii libxcb-res0-dbg 1.11.1-1ubuntu1 X C Binding, res extension, debugging symbols
ii libxcb-res0-dev 1.11.1-1ubuntu1 X C Binding, res extension, development files
ii libxcb-screensaver0 1.11.1-1ubuntu1 X C Binding, screensaver extension
ii libxcb-screensaver0-dbg 1.11.1-1ubuntu1 X C Binding, screensaver extension, debugging symbols
ii libxcb-screensaver0-dev 1.11.1-1ubuntu1 X C Binding, screensaver extension, development files
ii libxcb-shape0 1.11.1-1ubuntu1 X C Binding, shape extension
ii libxcb-shape0-dbg 1.11.1-1ubuntu1 X C Binding, shape extension, debugging symbols
ii libxcb-shape0-dev 1.11.1-1ubuntu1 X C Binding, shape extension, development files
ii libxcb-shm0 1.11.1-1ubuntu1 X C Binding, shm extension
ii libxcb-shm0-dbg 1.11.1-1ubuntu1 X C Binding, shm extension, debugging symbols
ii libxcb-shm0-dev 1.11.1-1ubuntu1 X C Binding, shm extension, development files
ii libxcb-sync-dev 1.11.1-1ubuntu1 X C Binding, sync extension, development files
ii libxcb-sync0 1.8.1-1ubuntu0.2 X C Binding, sync extension
ii libxcb-sync0-dbg 1.8.1-1ubuntu0.2 X C Binding, sync extension, debugging symbols
ii libxcb-sync1 1.11.1-1ubuntu1 X C Binding, sync extension
ii libxcb-sync1-dbg 1.11.1-1ubuntu1 X C Binding, sync extension, debugging symbols
ii libxcb-util-dev 0.4.0-0ubuntu3 utility libraries for X C Binding -- atom, aux and event
ii libxcb-util0 0.3.8-2 utility libraries for X C Binding -- atom, aux and event
ii libxcb-util0-dev 0.4.0-0ubuntu3 dummy transitional package for utility libraries for X C Binding -- atom, aux and event
ii libxcb-util1 0.4.0-0ubuntu3 utility libraries for X C Binding -- atom, aux and event
ii libxcb-xevie0 1.11.1-1ubuntu1 X C Binding, xevie extension
ii libxcb-xevie0-dbg 1.11.1-1ubuntu1 X C Binding, xevie extension, debugging symbols
ii libxcb-xevie0-dev 1.11.1-1ubuntu1 X C Binding, xevie extension, development files
ii libxcb-xf86dri0 1.11.1-1ubuntu1 X C Binding, xf86dri extension
ii libxcb-xf86dri0-dbg 1.11.1-1ubuntu1 X C Binding, xf86dri extension, debugging symbols
ii libxcb-xf86dri0-dev 1.11.1-1ubuntu1 X C Binding, xf86dri extension, development files
ii libxcb-xfixes0 1.11.1-1ubuntu1 X C Binding, xfixes extension
ii libxcb-xfixes0-dbg 1.11.1-1ubuntu1 X C Binding, xfixes extension, debugging symbols
ii libxcb-xfixes0-dev 1.11.1-1ubuntu1 X C Binding, xfixes extension, development files
ii libxcb-xinerama0 1.11.1-1ubuntu1 X C Binding, xinerama extension
ii libxcb-xinerama0-dbg 1.11.1-1ubuntu1 X C Binding, xinerama extension, debugging symbols
ii libxcb-xinerama0-dev 1.11.1-1ubuntu1 X C Binding, xinerama extension, development files
ii libxcb-xkb-dev 1.11.1-1ubuntu1 X C Binding, XKEYBOARD extension, development files
ii libxcb-xkb1 1.11.1-1ubuntu1 X C Binding, XKEYBOARD extension
ii libxcb-xkb1-dbg 1.11.1-1ubuntu1 X C Binding, XKEYBOARD extension, debugging symbols
ii libxcb-xprint0 1.11.1-1ubuntu1 X C Binding, xprint extension
ii libxcb-xprint0-dbg 1.11.1-1ubuntu1 X C Binding, xprint extension, debugging symbols
ii libxcb-xprint0-dev 1.11.1-1ubuntu1 X C Binding, xprint extension, development files
ii libxcb-xtest0 1.11.1-1ubuntu1 X C Binding, xtest extension
ii libxcb-xtest0-dbg 1.11.1-1ubuntu1 X C Binding, xtest extension, debugging symbols
ii libxcb-xtest0-dev 1.11.1-1ubuntu1 X C Binding, xtest extension, development files
ii libxcb-xv0 1.11.1-1ubuntu1 X C Binding, xv extension
ii libxcb-xv0-dbg 1.11.1-1ubuntu1 X C Binding, xv extension, debugging symbols
ii libxcb-xv0-dev 1.11.1-1ubuntu1 X C Binding, xv extension, development files
ii libxcb-xvmc0 1.11.1-1ubuntu1 X C Binding, xvmc extension
ii libxcb-xvmc0-dbg 1.11.1-1ubuntu1 X C Binding, xvmc extension, debugging symbols
ii libxcb-xvmc0-dev 1.11.1-1ubuntu1 X C Binding, xvmc extension, development files
ii libxcb1 1.11.1-1ubuntu1 X C Binding
ii libxcb1-dbg 1.11.1-1ubuntu1 X C Binding, debugging symbols
ii libxcb1-dev 1.11.1-1ubuntu1 X C Binding, development files
ii xcb 2.4-4.1 Pigeon holes for your cut and paste selections
You see that? I have installed all packages. -
@small_bird As I already said you need to install it on your target device/sysroot not your Ubuntu machine!
You're cross-compiling, right? That means you need libs/headers for your target platform. -
@small_bird "root@ubuntu:/opt/qt-everywhere-opensource-src-5.6.0# dpkg -l|grep xcb" - so you're on your Ubuntu host machine, right? Why are you logged on as root? You never should work as root! Put Qt source-code somewhere in your home directory instead of /opt then you don't need root to build. /opt is quite unusual location for source code.
-
@jsulm Hi, now I change my home directory to /home/smallbird("smallbird" is my user name), but I get the following result:
xcb auto-detection... ()
g++ -c -pipe -O2 -Wall -W -fPIC -I. -I/home/smallbird/tslib1.4/include -I/home/smallbird/GLES2 -I../../../mkspecs/linux-arm-gnueabi-g++ -o xcb.o xcb.cpp
xcb.cpp: In function ‘int main(int, char**)’:
xcb.cpp:39:23: warning: unused variable ‘t’ [-Wunused-variable]
xcb_connection_t *t = xcb_connect("", &primaryScreen);
^
arm-linux-g++ -Wl,-O1 -o xcb xcb.o -L/home/smallbird/openglES2libs-x86 -lGLESv2 -lts -lrt -lpthread -L/home/smallbird/tslib1.4/lib -lxcb
/home/smallbird/arm-2009q3/bin/../lib/gcc/arm-none-linux-gnueabi/4.4.1/../../../../arm-none-linux-gnueabi/bin/ld: xcb.o: Relocations in generic ELF (EM: 3)
/home/smallbird/arm-2009q3/bin/../lib/gcc/arm-none-linux-gnueabi/4.4.1/../../../../arm-none-linux-gnueabi/bin/ld: xcb.o: Relocations in generic ELF (EM: 3)
xcb.o: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
Makefile:84: recipe for target 'xcb' failed
make: *** [xcb] Error 1
xcb disabled.
The test for linking against libxcb failed!
You might need to install dependency packages for libxcb.
See src/plugins/platforms/xcb/README.Could you help me? Thanks in advance!
-
@small_bird Now you're using your host PC g++ compiler instead of the cross-compiler (arm-linux-g++). You used the correct compiler before, why do you use the wrong compiler now?
Now:xcb auto-detection... () g++ -c -pipe -O2 -Wall -W -fPIC -I. -I/home/smallbird/tslib1.4/include -I/home/smallbird/GLES2 -I../../../mkspecs/linux-arm-gnueabi-g++ -o xcb.o xcb.cpp
before
xcb auto-detection... () arm-linux-g++ -lts -c -pipe -O2 -Wall -W -fPIC -I. -I../../../mkspecs/linux-arm-gnueabi-g++ -o xcb.o xcb.cpp
-
@small_bird You're using wrong compiler to compile but the cross-compiler to link. I updated my previous post.
-
@jsulm It is quite strange, I have the qmake.conf like this:
modifications to g++.conf
QMAKE_CC = arm-linux-gcc -lts
QMAKE_LINK = arm-linux-g++ -lts
QMAKE_LINK_SHLIB = arm-linux-g++ -ltsmodifications to linux.conf
QMAKE_AR = arm-linux-ar cqs
QMAKE_OBJCOPY = arm-linux-objcopy
QMAKE_NM = arm-linux-nm -P
QMAKE_STRIP = arm-linux-stripYou see that? I have already set the paremeter.
-
@jsulm Ok, now I have solved the problem. I added one line to the qmake.conf file, now the file is like this:
Now:
modifications to g++.conf
QMAKE_CC = arm-linux-gcc -lts
QMAKE_CXX = arm-linux-g++ -lts
QMAKE_LINK = arm-linux-g++ -lts
QMAKE_LINK_SHLIB = arm-linux-g++ -ltsmodifications to linux.conf
QMAKE_AR = arm-linux-ar cqs
QMAKE_OBJCOPY = arm-linux-objcopy
QMAKE_NM = arm-linux-nm -P
QMAKE_STRIP = arm-linux-stripBefore:
modifications to g++.conf
QMAKE_CC = arm-linux-gcc -lts
QMAKE_LINK = arm-linux-g++ -lts
QMAKE_LINK_SHLIB = arm-linux-g++ -ltsmodifications to linux.conf
QMAKE_AR = arm-linux-ar cqs
QMAKE_OBJCOPY = arm-linux-objcopy
QMAKE_NM = arm-linux-nm -P
QMAKE_STRIP = arm-linux-strip
load(qt_config)However, I got the following result:
xcb auto-detection... ()
arm-linux-g++ -lts -c -pipe -O2 -Wall -W -fPIC -I. -I/home/smallbird/tslib1.4/include -I../../../mkspecs/linux-arm-gnueabi-g++ -o xcb.o xcb.cpp
xcb.cpp:34: fatal error: xcb/xcb.h: No such file or directory
compilation terminated.
Makefile:172: recipe for target 'xcb.o' failed
make: *** [xcb.o] Error 1
xcb disabled.
The test for linking against libxcb failed!
You might need to install dependency packages for libxcb.
See src/plugins/platforms/xcb/README.Why?The packages are all installed.
-
@small_bird said in When I configure qt5.6, it shows that xcb failed! Why?:
xcb/xcb.h
Is xcb/xcb.h there? And if so where exactly is it?
-
If you are using Qt's 3rdparty xcb, you should say so in the configure options.
-
@SGaist Yes, I have added -qt-xcb option, my configure is as following:
#!/bin/sh
./configure
-v
-prefix /home/smallbird/qt5.6.0
-release
-continue
-confirm-license
-plugin-sql-sqlite
-qt-libjpeg
-qt-libpng
-qt-zlib
-no-c++11
-qt-xcb
-opensource
-xplatform linux-arm-gnueabi-g++
-force-pkg-config
-make examples
-no-dbus
-pkg-config
-qt-freetype
-qt-pcre
-I/home/smallbird/tslib1.4/include
-L/home/smallbird/tslib1.4/libexit
-
@jsulm
As I did not designate the sysroot option, the compiler should seek the headers and libraries in the folder /usr/include.
Now the folder has the xcb/xcb.h. However the result is still the same:"xcb auto-detection... ()
arm-linux-g++ -lts -c -pipe -O2 -Wall -W -fPIC -I. -I../../../mkspecs/linux-arm-gnueabi-g++ -o xcb.o xcb.cpp
xcb.cpp:34: fatal error: xcb/xcb.h: No such file or directory
compilation terminated.
Makefile:172: recipe for target 'xcb.o' failed
make: *** [xcb.o] Error 1
xcb disabled.
The test for linking against libxcb failed!
You might need to install dependency packages for libxcb.
See src/plugins/platforms/xcb/README.
"
How could it be like that? This is my /usr/include:
root@ubuntu:/home/smallbird/qt-everywhere-opensource-src-5.6.0# ls /usr/include/
aio.h expat_external.h lastlog.h netipx rpcsvc termios.h
aliases.h expat.h libgen.h netiucv sched.h tgmath.h
alloca.h fcntl.h libintl.h netpacket scsi thread_db.h
argp.h features.h libio.h netrom search.h time.h
argz.h fenv.h libpng netrose semaphore.h ttyent.h
ar.h fmtmsg.h libpng12 nfs setjmp.h uapi
arpa fnmatch.h limits.h nl_types.h sgtty.h uchar.h
asm-generic fontconfig link.h nss.h shadow.h ucontext.h
assert.h freetype2 linux obstack.h signal.h ulimit.h
autosprintf.h fstab.h locale.h paths.h sound unistd.h
byteswap.h fts.h malloc.h pngconf.h spawn.h ustat.h
c++ ftw.h math.h png.h stab.h utime.h
complex.h _G_config.h mcheck.h poll.h stdc-predef.h utmp.h
cpio.h gconv.h memory.h printf.h stdint.h utmpx.h
crypt.h getopt.h misc protocols stdio_ext.h values.h
ctype.h gettext-po.h mntent.h pthread.h stdio.h video
dirent.h glob.h monetary.h pty.h stdlib.h wait.h
dlfcn.h gnumake.h mqueue.h pwd.h string.h wchar.h
drm gnu-versions.h mtd python3.5m strings.h wctype.h
elf.h grp.h net rdma stropts.h wordexp.h
endian.h gshadow.h netash re_comp.h sudo_plugin.h X11
envz.h i386-linux-gnu netatalk regex.h syscall.h xcb
err.h iconv.h netax25 regexp.h sysexits.h xen
errno.h ifaddrs.h netdb.h reglib syslog.h xlocale.h
error.h inttypes.h neteconet resolv.h tar.h xorg
execinfo.h langinfo.h netinet rpc termio.h zlib.hThis is what xcb folder contains:
root@ubuntu:/home/smallbird/qt-everywhere-opensource-src-5.6.0# ls /usr/include/xcb/
bigreq.h glx.h screensaver.h xcb_cursor.h xcb_image.h xevie.h xproto.h
composite.h present.h shape.h xcb_event.h xcb_keysyms.h xf86dri.h xtest.h
damage.h randr.h shm.h xcb_ewmh.h xcb_pixel.h xfixes.h xv.h
dpms.h record.h sync.h xcbext.h xcb_renderutil.h xinerama.h xvmc.h
dri2.h render.h xcb_atom.h xcb.h xcb_util.h xkb.h
dri3.h res.h xcb_aux.h xcb_icccm.h xc_misc.h xprint.hYou might say that I should not use the super user as root, but if not, some folders could not be entered. Could you offer me help? Thanks a lot!
-
@SGaist Someone told me : "You don't have X11 development packages installed for the arm target, then. Stuff in /usr/include/X11 is for the host, not for the target." However, I wonder how to install the packages for the arm target !