How to use qmake to cross-compile for imx6?
-
@Alexander-9 You need to cross-compile for your target. You can see how it is done for Raspberry Pi here http://wiki.qt.io/RaspberryPi_Beginners_Guide (don't know what your target device is, but it will be similar).
-
To add to @jsulm, that's normal. When cross-compiling there are host tools like qmake that will be built for your desktop machine so your can develop on said machine while targeting your device.
If you want build your application directly on your target then you'll have to do a native Qt build on your target also.
-
@jsulm , @SGaist I intented run of cross-compiler with next way:
./configure -release -opengl es2 -device linux-imx6-g++ -device-option CROSS_COMPILE=/opt/poky/2.0/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi- -opensource -confirm-license -prefix /opt/imx6, this way of cross-compile is correct??
But show me this ERROR: Cannot compile a minimal program. The toolchain or QMakeSpec is broken., and for details Config.log, in this moment i'm seraching the way for add the files crt1.o, crti.o etc, etc, regards.
-
You are at least missing the
sysroot
option. -
@Alexander-9 Sysroot is a directory containing the content of the target device file system (or parts of it). It must contain all needed header files and libraries from your target device, else you cannot cross-compile.
-
@jsulm, @SGaist , this the new cross-compile: ./configure -release -opengl es2 -device linux-imx6-g++ -device-option CROSS_COMPILE=/opt/poky/2.0/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi- -sysroot /dev/sdd -opensource -confirm-license -prefix /opt/imx6, is correct this??
after of run the configure, show me in the Config.log:
executing config test verifyspec
- cd /home/qt/Descargas/qt5/qtbase/config.tests/common/verifyspec && /home/qt/Descargas/qt5/qtbase/bin/qmake -qtconf /home/qt/Descargas/qt5/qtbase/bin/qt.conf "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared console" "QMAKE_CFLAGS += --sysroot=/dev/sdd" "QMAKE_CXXFLAGS += --sysroot=/dev/sdd" "QMAKE_LFLAGS += --sysroot=/dev/sdd" /home/qt/Descargas/qt5/qtbase/config.tests/common/verifyspec
- cd /home/qt/Descargas/qt5/qtbase/config.tests/common/verifyspec && MAKEFLAGS= /usr/bin/make clean && MAKEFLAGS= /usr/bin/make
rm -f verifyspec.o
rm -f *~ core *.core
/opt/poky/2.0/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-g++ -c -pipe -march=armv7-a -mfpu=neon -DLINUX=1 -DEGL_API_FB=1 -mfloat-abi=hard --sysroot=/dev/sdd -O2 -std=gnu++11 -Wall -W -fPIC -I. -I/home/qt/Descargas/qt5/qtbase/mkspecs/devices/linux-imx6-g++ -o verifyspec.o verifyspec.cpp
cc1plus: error: /dev/sdd/usr/include/c++/5.2.0: Not a directory
cc1plus: error: /dev/sdd/usr/include/c++/5.2.0/arm-poky-linux-gnueabi: Not a directory
cc1plus: error: /dev/sdd/usr/include/c++/5.2.0/backward: Not a directory
cc1plus: error: /dev/sdd/usr/lib/gcc/arm-poky-linux-gnueabi/5.2.0/include: Not a directory
cc1plus: error: /dev/sdd/usr/local/include: Not a directory
cc1plus: error: /dev/sdd/usr/include: Not a directory
Makefile:1006: fallo en las instrucciones para el objetivo 'verifyspec.o'
make: *** [verifyspec.o] Error 1I have that install more packges??
Regards
-
/dev/sdd
? Highly unlikely since it represent a drive on your system not even a partition but the whole physical drive.You need to pass the folder where you copied your device file system.
-
@SGaist @jsulm I already add the sysroot ./configure -release -opengl es2 -device linux-imx6-g++ -device-option CROSS_COMPILE=/opt/poky/2.0/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi- -sysroot /media/qt/rootfs/ -prefix /usr/local/qt5, the sysroot contain the folders: bin, build, boot, etc, is correct??
Generates me this error of compilation: Config.log.
-
Did you do it from a clean state ?
-
@SGaist I have executed the command make clean, is correct or i have run other command??
-
Well, the best thing to do is an out of source build, so if something goes wrong you just nuke the folder and start anew. This has also the advantage to leave the sources untouched.
-
Because also delete of folder qt-everywhere-opensource-src-5.8.0 and again extract qt-everywhere-opensource-src-5.8.0.zip for run the ./configure
-
Avoiding to delete and decompression of the source each time will be a gain of time.
-
So what you recommend me to do??
-
I already wrote it: use out of source builds.