Olimex Support Forum

OLinuXino Android / Linux boards and System On Modules => A20 => Topic started by: Cosik on October 27, 2014, 12:25:26 PM

Title: [HowTo] Setting Up Qt Creator for cross compile
Post by: Cosik on October 27, 2014, 12:25:26 PM
This topic is continuation of this topic [HowTo] Cross compile Qt5 (https://www.olimex.com/forum/index.php?topic=3825.0)

You could configure yours Qt Creator in those steps

Start Qt Creator.
Bring up the options dialog using Tools -> Options....
Select the Devices page on the left.
Click Add...
Select Generic Linux Device and click Start Wizard.

(https://lh4.googleusercontent.com/-SOMt72N5xEQ/VE4O61mrLBI/AAAAAAAAA48/UaZSMdByqeg/w1004-h575-no/2.png)

Enter the name of the device.
Enter the IP address for your board.
Enter "olimex" for the username (some times you need to run yours program as a root).
Enter "olimex" for the password.

(https://lh4.googleusercontent.com/-fnrDg5MP_3c/VE4OLan2TvI/AAAAAAAAA4k/IB3RvaTfAMA/w740-h385-no/3.png)

Select the Build & Run page on the left.
Select the Compilers tab.
Using the Add button, add a GCC compiler.
Name the compiler for example "A20 Lime".
Set the path to the toolchain arm-linux-gnueabihf-g++

(https://lh3.googleusercontent.com/-Sk9hEDCOYFk/VE4OLhKt3UI/AAAAAAAAA4g/2p7UobH83kg/w1013-h638-no/4.png)


Select the Qt Versions tab.
Using Add... add a new Qt version.
Select the path to the appropriate qmake: "/opt/qt5.3.2olim2/bin/qmake".

(https://lh6.googleusercontent.com/-0EnxjTyxNSg/VE4OMDmsfCI/AAAAAAAAA4U/BOgeE1TS7CU/w1013-h638-no/5.png)

Select the Kits tab.
Click Add button to add a kit.
Enter name e.g. "A20-Lime
Select Generic Linux Device and Raspberry Pi for device type and device.
Enter "/mnt/a20" for the sysroot
Select Toolchain for the compiler.
Browse to yours cross compiler arm-linux-gnueabihf-gdb for the debugger.
Select qt for the Qt Version.
Click OK to finalize the configuration.

(https://lh3.googleusercontent.com/-7nEaN4-sasw/VE4OMSZwcbI/AAAAAAAAA4o/iobdrnd6a6g/w1013-h638-no/6.png)

In new project it's necessary to add two lines to qt project file:
target.path = /home/olimex
INSTALLS += target


target.path - determinate where your program will be installed on target.

References:
Building Qt 5 on Raspberry Pi (http://www.ics.com/blog/building-qt-5-raspberry-pi#.U0ubso_7sYy)