Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
[Solved] Building Qt to develop for Embedded Linux Module
I've used these forums a lot in the past, and they have helped me a lot when I was just starting out. But now I pose a problem.
My problem is as follows:
I am developing for an ARIA-G25 Embedded Linux module. It runs Emdebian 7.1 Wheezy with Linux kernel version 3.11.6.
My development started out running Tiny Core in a virtual machine in Windows. Tiny Core was already setup with QtCreator, and everything I needed to compile apps and run them on the embedded linux module. But Now I would like to develop using Ubuntu, which is much easier for me.
I am noob-new when it comes to compiling qt myself. How do I go about to setup Qt on Ubuntu in order to compile apps to run on my embedded linux module?
Hi and welcome to devnet,
It will depend on which version of Qt you want to use on your board. If you want to create a GUI program: do you have an X server running, only frame buffer, hardware acceleration etc…
But basically, you will need a cross-compiler, that might already be provided by the ARIA-G25 manufacturer. You can ask them about their Tiny Core setup to replicate it on your Ubuntu.
Hope it helps
Well, the software I have to develop is console based. It only has to interface with the GPIO's, serial ports, LAN, etc. Does the Qt version really matter, since I want to build them on Ubuntu and run them on the board?
And by cross-compiler, do you mean like arm-linux-gnueabi cross compiler I am using?
Thanks for the reply!
It all depends on the features you need, constraints you have, enterprise rules etc… Be it 4 or 5 doesn't matter from a compilation point of view, it's more about which one is already supported by the board's distribution/cross-compiliation environment
The Qt version I was using on Tiny Core is 4.8.5. So, knwowing that and having already installed the cross compiler on Ubuntu (which I have already tested, since I rebuilt the kernel on ubuntu), what is the next step?
I have only recently begun to piece together everything I learned about Qt. And from what I understand is that I have to build qt from the Qt Embedded sources.
I followed those steps. And at:
./configure -embedded [architecture]
I replaced [architecture] with arm.
That's correct, the just install it and add this Qt version to Qt Creator and a Kit that uses it.
The you will have to configure Qt Creator to connect to your board (you can copy the information from the version you where using in Tiny Core)
Hi there SGaist,
I finally got my Qt setup! So I figured if anyone else struggles like I did , they can just follow my steps:
Note: I installed Qt Creator 3 and used the Qt Everywhere 4.8.5 sources.
After unpacking the Qt Sources, edit the edit mkspecs/qws/linux-arm-gnueabi-g++/qmake.conf file as follows:
qmake configuration for building with armel
MAKEFILE_GENERATOR = UNIX
TEMPLATE = app
CONFIG += qt warn_on release incremental link_prl
QT += core gui
QMAKE_INCREMENTAL_STYLE = sublib
CROSS_GNU_ARCH = arm-linux-gnueabi
warning("preparing QMake configuration for $$CROSS_GNU_ARCH")
CONFIG += $$CROSS_GNU_ARCH
QMAKE_CC = $$CROSS_GNU_ARCH-gcc
QMAKE_CXX = $$CROSS_GNU_ARCH-g++
QMAKE_LINK = $$CROSS_GNU_ARCH-g++
QMAKE_LINK_SHLIB = $$CROSS_GNU_ARCH-g++
QMAKE_LINK_C = $$CROSS_GNU_ARCH-gcc
QMAKE_LINK_C_SHLIB = $$CROSS_GNU_ARCH-gcc
QMAKE_AR = $$CROSS_GNU_ARCH-ar cqs
QMAKE_OBJCOPY = $$CROSS_GNU_ARCH-objcopy
QMAKE_STRIP = $$CROSS_GNU_ARCH-strip
Then run ./configure with the following tags (in the folder's main directory):
This might take a while. After these steps run
sudo make install
I used sudo just to make sure the process doesn't fail due to permissions.
Next, in Qt Creator, add a Compiler Kit. I left Device Type as Desktop. I set Compiler to /usr/bin/arm-linux-gnueabi-g++ (since this is the cross compiler I am using. And lastly, I set Qt Version to /usr/local/arm/qt/4.8.4/bin/qmake (the directory of my cross compiled qt).
I had the problem of Qt not having any header files. So I added the following in the pro file.
INCLUDEPATH += /usr/local/arm/qt/4.8.4/include
INCLUDEPATH += /usr/local/arm/qt/4.8.4/lib
And I copied all the files from /usr/local/arm/qt/4.8.4/lib to /lib. I dont know if the last steps were how it should be done. But it worked for me. And now I can code and compile on Ubuntu, and run the apps on my Embedded Linux Module.