I installed the compiler to work with Arm ( g ++ - arm-linux-gnueabihf , and gcc-multilib, g ++ - multilib for cross-platform compilation), set up Kit'y to work with this compiler and the connected device - everything works fine with std c ++ 11 . Now I want it to work with Qt. My plan is to compile Qt, connect this version to an existing Keith, connect Qt statically to my project and execute the target binary on Arm.

I would be grateful for any of your instructions tips that I want to read before starting the configuration / compilation / installation, so as not to step on the same rake.

  • Qt want to compile 5.7

  • Ubuntu OS 15.10 64bit OS

  • Qt Creator 3.6.0

  • Arm costs 32 bits of Debian GNU / Linux 7

It is important that no graphics on Armagh do not need to be done, in my opinion this should facilitate the task. Project type will be Qt based console C ++


Is this configuration good, for example:

./configure -prefix /home/[myname mine/Qt-custom/qt-embedded-5.7 -debug -static -qt-zlib -qt-sql-sqlite2 -no-qml-debug -no-widgets -no-gui - no-opengl -openssl-linked -opensource -confirm-license -silent

? What else to add / subtract? -embedded flag in the fifth seems to be no longer valid (?)

At what stage will you need to specify the g ++ compiler - arm-linux-gnueabihf ? At the configuration stage or later?


Edited: what to enter for the option -platform ?


So there was a question what to enter for the platform flag. It turned out that all the "platforms" lie in qtbase / mkspecs . Now the answer to the question "where to specify the compiler is clarified. I found there a platform close to the one I need : linux-arm-gnueabi-g ++ . This is also the same as linux-arm-gnueabihf-g ++ , but without floating point support. I went to hack - copied linux -arm-gnueabi-g ++ in linux-arm-gnueabihf-g ++ and wrote the compiler I needed (installed in me) into qmake.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 

Config worked, but here a new biada:

 Creating qmake... make: Nothing to be done for 'first'. Running configuration tests... Failed to process makespec for platform 'linux-arm-gnueabihf-g++' ... Syntax error: word unexpected (expecting ")") 

Out of curiosity, I installed g ++ - arm-linux-gnueabi and complied with the "legal" platform:

 -platform linux-arm-gnueabi-g++ 

poured out:

 Creating qmake... /usr/lib/gcc-cross/arm-linux-gnueabi/5/../../../../arm-linux-gnueabi/bin/ld: error: project.o uses VFP register arguments, ../bin/qmake does not /usr/lib/gcc-cross/arm-linux-gnueabi/5/../../../../arm-linux-gnueabi/bin/ld: failed to merge target specific data of file project.o /usr/lib/gcc-cross/arm-linux-gnueabi/5/../../../../arm-linux-gnueabi/bin/ld: error: option.o uses VFP register arguments, ../bin/qmake does not /usr/lib/gcc-cross/arm-linux-gnueabi/5/../../../../arm-linux-gnueabi/bin/ld: failed to merge target specific data of file option.o 

(I spoke about this above - g ++ - arm-linux-gnueabi does not support floating points, but even the "legal" version is not just installed

By the way, I found recommendations about what I was doing, but in practice it does not work because of Syntax error: word unexpected (expecting ")") . I'll try to combine flags


And I got stuck on this error. Syntax error: word unexpected (expecting ")")

The current configuration I'm trying to run:

./configure -prefix /home/rishat/Qt-custom/qt-embedded-5.7 -debug -platform linux-arm-gnueabihf-g ++ -qt-zlib -qt-sql-sqlite2 -no-qml-debug -no-widgets -no-gui -no-opengl -openssl-linked -opensource -confirm-license -v

  • For example: radix.pro, buildroot etc. From your question it is not very clear what kind of "cross-platform compilation" you have. And with the help of the above systems, you can do cross-platform for different platforms. - user1056837
  • @ user1056837 gcc-multilib g ++ - multilib installed and everything worked. Now the problem is correct Qt build - asianirish

2 answers 2

-platform - host arhtektura

-xplatform - target

Well, if you looked at least in the English segment, you would see a fair number of similar questions with answers.

  • Yes, with -xplatform went, though some libraries are missing, but I think I’ll figure it out. Hopefully it goes on - asianirish
  • Please listen to the advice and use the tools for cross-compilation. This is a much more reliable approach. - user1056837
  • After a number of shamanism issued QTBUG-36129 ( bugreports.qt.io/browse/QTBUG-36129 ) You probably have to try your tools (or do a project on std + boost). Thanks for the tips! I leave this question closed and ask a separate question about this bug, maybe someone knows a workout - asianirish

Achieved success with the following configuration:

./configure -prefix /home/asianirish/Qt-custom/qt-embedded-openssl-5.7 -debug -static -xplatform linux-arm-gnueabihf-g ++ -skip qtconnectivity -skip qtdeclarative -skip qtlocation -skip qtmultimedia-of-skip qtdeclarative -skip qtlocation -skip qtmultimedia-of-apip-skip qtdeclarative skip qtsensors -skip qttools -skip qtwebsockets -skip qtwinextras -skip qtwebchannel -skip qtwebengine -nomake examples -qt-zlib -c ++ std c ++ 11 -no-sql-sqlite2 -no-sql-psql -no-sql- mysql -no-sql-odbc -no-sql-oci -no-sql-ibase -no-sql-db2 -no-opengl -sysroot / home / asianirish / olimex / -opensource -confirm-license -v

Enabled the -sysroot flag for the availability of some libraries.

Everything compiles with Qt and runs on Armagh. Thank you so much @ user1056837 for valuable advice. I leave my answer in case someone comes in handy in a similar situation.