QT5 Cross Compiled from linux-x86 to linux-arm
-
Hi.
I'm new with QT and ARM.
I had success with cross compile qt4 (4.8.5) from linux to linux-arm-gnueabihf-g++ but not with qt5 (5.1.1) (it has some changes).
I am using:
Linux x86: Ubuntu 12.04
QT5 Source: qt-everywhere-opensource-src-5.1.1
Toolchain: gcc-linaro-arm-linux-gnueabihf-4.7.
Linux ARM: UbuntuI copied mkspecs/linux-arm-gnueabi-g++ folder to mkspecs/linux-arm-gnueabihf-g++ folder and I have modified qtmake.conf as:
@#
qmake configuration for building with arm-linux-gnueabi-g++
MAKEFILE_GENERATOR = UNIX
CONFIG += incremental gdb_dwarf_index
QMAKE_INCREMENTAL_STYLE = sublibinclude(../common/linux.conf)
include(../common/gcc-base-unix.conf)
include(../common/g++-unix.conf)modifications to g++.conf
QMAKE_CC = arm-linux-gnueabihf-gcc
QMAKE_CXX = arm-linux-gnueabihf-g++
QMAKE_LINK = arm-linux-gnueabihf-g++
QMAKE_LINK_SHLIB = arm-linux-gnueabihf-g++modifications to linux.conf
QMAKE_AR = arm-linux-gnueabihf-ar cqs
QMAKE_OBJCOPY = arm-linux-gnueabihf-objcopy
QMAKE_NM = arm-linux-gnueabihf-nm -P
QMAKE_STRIP = arm-linux-gnueabihf-strip
load(qt_config)@I have some problems with qt5 configure.
I want develop a QT app with a GUI on Linux x86 (Ubuntu 12.04) and compile for ARM Linux (Ubuntu).
With QT4 I did a QT4 cross compilation and then I copied this libs to ARM platform with my compiled app and run ok. I have to use -qws to launch it.
On QT5 there are some changes (QWS has dissapear for example)
I have some errors with the configure. And I have not clear what may be the proper configuration.
./configure -prefix /opt/qt5.1.1-arm -release -make libs -make examples -make tools -xplatform linux-arm-gnueabihf-g++ -no-opengl -confirm-license -opensource -xcb -no-pch -no-kms -v -no-icu
The errors:
arm-linux-gnueabihf-g++ -c -fvisibility=hidden fvisibility.c
arm-linux-gnueabihf-g++: error trying to exec 'cc1plus': execvp: No existe el archivo o el directorio
Symbol visibility control disabled.
arm-linux-gnueabihf-g++ -o libtest.so -shared -Wl,-Bsymbolic-functions -fPIC bsymbolic_functions.c
arm-linux-gnueabihf-g++: error trying to exec 'cc1plus': execvp: No existe el archivo o el directorio
Symbolic function binding disabled.This is the Qt Open Source Edition.
You are licensed to use this software under the terms of
the Lesser GNU General Public License (LGPL) versions 2.1.You have already accepted the terms of the license.
Creating qmake...
make: No se hace nada para «first».
Running configuration tests...
Warning: Disabling pkg-config since PKG_CONFIG_LIBDIR is not set.
Warning: Disabling pkg-config since PKG_CONFIG_SYSROOT_DIR is not set.
Determining architecture... ()
arm-linux-gnueabihf-g++ -c -pipe -g -Wall -W -fPIE -I../../mkspecs/linux-arm-gnueabihf-g++ -I. -o arch.o arch.cpp
arm-linux-gnueabihf-g++: error trying to exec 'cc1plus': execvp: No existe el archivo o el directorio
Assembler messages:
Fatal error: invalid -march= option: `armv7-a'
make: *** [arch.o] Error 1
Unable to determine architecture!Could not determine the target architecture!
Turn on verbose messaging (-v) to see the final report.
Determining architecture... ()
g++ -c -pipe -g -Wall -W -fPIE -I../../mkspecs/linux-g++ -I. -o arch.o arch.cpp
g++ -o arch arch.o
{ test -n "" && DESTDIR="" || DESTDIR=.; } && test $(gdb --version | sed -e 's,[^0-9]+([0-9]).([0-9]).*,\1\2,;q') -gt 72 && gdb --nx --batch --quiet -ex 'set confirm off' -ex "save gdb-index $DESTDIR" -ex quit 'arch' && test -f arch.gdb-index && objcopy --add-section '.gdb_index=arch.gdb-index' --set-section-flags '.gdb_index=readonly' 'arch' 'arch' && rm -f arch.gdb-index || true
Found architecture in binary
CFG_HOST_ARCH="i386"
CFG_HOST_CPUFEATURES=""
System architecture: 'unknown'
Host architecture: 'i386'
C++11 auto-detection... ()
arm-linux-gnueabihf-g++ -c -pipe -O2 -std=c++0x -Wall -W -fPIE -I../../../mkspecs/linux-arm-gnueabihf-g++ -I. -o c++11.o c++11.cpp
arm-linux-gnueabihf-g++: error trying to exec 'cc1plus': execvp: No existe el archivo o el directorio
Assembler messages:
Fatal error: invalid -march= option: `armv7-a'
make: *** [c++11.o] Error 1
C++11 disabled.
floatmath auto-detection... ()....
....
....xcb disabled.
The test for linking against libxcb failed!
You might need to install dependency packages for libxcb.
See src/plugins/platforms/xcb/README.I have instaled the dependency libs on src/plugins/platforms/xcb/README.
sudo apt-get install libxcb1 libxcb1-dev libx11-xcb1 libx11-xcb-dev libxcb-keysyms1 libxcb-keysyms1-dev libxcb-image0 libxcb-image0-dev libxcb-shm0 libxcb-shm0-dev libxcb-sync0 libxcb-sync0-dev libxcb-render-util0 libxcb-render-util0-dev libxcb-xfixes0-dev libxrender-dev libxcb-shape0-dev libxcb-randr0-dev libxcb-glx0-dev
I'm lost, I appreciate any help.
Thanks.
-
Hi,
From a quick overview, you need to get the dependencies for ARM not for x86 and from you error it seems that your cross-compiler is not found (but I may be wrong, I'm not fluent in Italian)
-
Hi,
My toolchain is on usr/bin
I tried also with QMAKE_CC = /usr/bin/xcompiler-gcc but I get the same error.
With Qt4 I had no problem but QT5 seems that is not the same way. Anybody can explain step by step how to make cross compiling I need?
Thanks for your help.