Solved When I configure Qt 5.6, it shows that xcb failed! Why?
-
@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
-
@jsulm No ,It is arm-linux-g++.
As this line shows:
arm-linux-g++ -Wl,-O1 -o xcb xcb.o -L/home/smallbird/openglES2libs-x86 -lGLESv2 -lts -lrt -lpthread -L/home/smallbird/tslib1.4/lib -lxcbAm I right?
-
@small_bird You're using wrong compiler to compile but the cross-compiler to link. I updated my previous post.
-
@jsulm OK, I have saw that. I'd check my parameter.
-
@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?
-
@jsulm Yes, it is there.
It is located in /home/smallbird/qt-everywhere-opensource-src-5.6.0/qtbase/src/3rdparty/xcb/sysinclude. -
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 !
-
@small_bird In another thread I told you that you need a sysroot to cross compile. The content of /usr on your host PC is completely unrelated to your target device. What is your device? What Linux distribution is running on it (I assume you're using Linux)? You really should read about cross-compiling.
-
@jsulm My device is arm-cortexA8. The linux distribution is based on linux3.2, not a offical distribution. I know what you mean, then where can I get the headers and libraries for the device.
-
@small_bird So, on your device Ubuntu is running, right?
In that case start it log on on it (remotely over SSH or directly if you can connect a monitor and keyboard) and use apt-get to install all needed packages. -
@jsulm I am sorry that I have corrected the answer. According to the offical description, the distribution installed on PC is the same as that on the arm board. So after I use cross-compiler to compile the qt5.6 source code, the libraries it generates should be avaliable for the arm board. Why should I install the packages on the board ?
-
@small_bird Could you please read about cross-compiling?
I already provided a link in one of your threads.
What you need is a sysroot containing libraries AND include files for your target architecture.
Lets say you cross-compile your app which depends on a library. In your code you include header files needed to use that library. Now the question is where are the library and its header files? You cannot use what is installed on your host PC as it is for a different architecture (your PC is most probably x86_64, right?). So, you need a sysroot containing that lib and header files. One way to get that sysroot is to mount the file system from your target device in your PC. If you're using Raspberry Pi (you still didn't say what your device actually is, arm-cortexA8 is not a device it is a CPU architecture) you can just put the SD card into your PC and mount it - then you have a sysroot. -
@jsulm Thanks a lot for your patient reply ! My device is OK335XD, you might not hear that.
-
@jsulm Now I will follow your advice and have a try. Thanks once more !