I want to compile a Qt program for an ARM device.
I installed the toolchain for ARM and here is how my qmake.conf file looks like:
#
# qmake configuration for building with arm-none-linux-gnueabi-g++
#
include(../../common/linux.conf)
include(../../common/gcc-base-unix.conf)
include(../../common/g++-unix.conf)
include(../../common/qws.conf)
# modifications to g++.conf
QMAKE_CC = arm-linux-gnueabi-gcc
QMAKE_CXX = arm-linux-gnueabi-g++
QMAKE_LINK = arm-linux-gnueabi-g++
QMAKE_LINK_SHLIB = arm-linux-gnueabi-g++
QMAKE_CFLAGS += -O3 -march=armv5te
QMAKE_CXXFLAGS += -O3 -march=armv5te
QMAKE_INCDIR_QT = /opt/FriendlyARM/toolschain/4.5.1/arm-none-linux-gnueabi/include
QMAKE_INCDIR_QT = /usr/share/qt4/include
QMAKE_LIBDIR_QT = /opt/FriendlyARM/toolschain/4.5.1/arm-none-linux-gnueabi/lib
# modifications to linux.conf
QMAKE_AR = arm-linux-gnueabi-ar cqs
QMAKE_OBJCOPY = arm-linux-gnueabi-objcopy
QMAKE_STRIP = arm-linux-gnueabi-strip
load(qt_config)
The problem is that if I include (as shown above):
QMAKE_INCDIR_QT = /opt/FriendlyARM/toolschain/4.5.1/arm-none-linux-gnueabi/include
QMAKE_INCDIR_QT = /usr/share/qt4/include
QMAKE_LIBDIR_QT = /opt/FriendlyARM/toolschain/4.5.1/arm-none-linux-gnueabi/lib
I get an error that says :
main.cpp:1:30: fatal error: QtGui/QApplication: No such file or directory
And if I exclude :
QMAKE_INCDIR_QT = /opt/FriendlyARM/toolschain/4.5.1/arm-none-linux-gnueabi/include
QMAKE_LIBDIR_QT = /opt/FriendlyARM/toolschain/4.5.1/arm-none-linux-gnueabi/lib
I get an error that says :
/usr/include/qt4/QtCore/qatomic_x86_64.h:133:29: error: impossible constraint in ‘asm’
I am new to this and have been struggling for over 40 hours this week and can't find what's the problem.
I can compile a simple c++ program for the ARM device, but when I try to use Qt I get the above errors so I think that the problem is in 1 case that the Qt headers are not loaded and in the other that the wrong converter file from c++ to asm is used.
qmake -spec linux-arm-gnueabi-g++without your custom ARM setup?qt4/mkspecs/qws/linux-arm-gnueabi-g++in which I addedQMAKE_CFLAGS += -O3 -march=armv5te QMAKE_CXXFLAGS += -O3 -march=armv5te QMAKE_INCDIR_QT = /opt/FriendlyARM/toolschain/4.5.1/arm-none-linux-gnueabi/include QMAKE_INCDIR_QT = /usr/share/qt4/include QMAKE_LIBDIR_QT = /opt/FriendlyARM/toolschain/4.5.1/arm-none-linux-gnueabi/libbecause I was confused why the x86_64 header is used. If I remove the above rows and let it be like it was when installed I get/usr/include/qt4/QtCore/qatomic_x86_64.h:133:29: error: impossible constraint in ‘asm’.qmake -spec linux-arm-gnueabi-g++as suggested.