Cross compile qt application for Rasperry Pi - qt

I want to build an example from the QT5 folder for my raspberry pi. I have a working cross compiler and qt5.0.2 installed on my ubuntu. Is this enough to build an application for my device? Do I have to provide any specific qt embedded libs?
For example do I have to take the QT libs from my embedded linux for the applicaiotn on the host to build?
edit:
as mentioned here (http://qt-project.org/wiki/RaspberryPi_Beginners_guide) it says:
"Then go to the “Rasperry Pi” kit tab->System Environment and add LD_LIBRARY_PATH which is set to /usr/local/qt5pi/lib"
This is a qt version build for the PI. So yes I guess I need some specific QT libs which are build for my PI device. The question is now do I have to rebuild these on my own or can I get these from my device directly?

Related

How to install QT on Ubuntu for Cross compiling

I know there are tons of informations out there on the web about my question.
I have searched and tried for at least 2 days to get my setup up and running. But there are many unclear points and i would be very happy if someone could help me with answering my questions.
My situation:
I have an i.MX6 Eval Board on my desk which is running uboot with Linux Kernel 4.9.2. There is no distro on top. Just the kernel with busybox.
Attached to the board is a LCD TFT which is accesed through the Framebuffer. There is no GPU in the Processor.
To compile uboot and the kernel, i use the linaro toolchain gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf This toolchain is located at /opt/toolchain. The compilation of the kernel and uboot works without any problems.
Now i would like to start the application development with QT Creator. I have therefore read a lot of topics on various forums and sites on the web. Unfortunately i did not get it working.
First of all i have a confusion about the meaning of the title: http://doc.qt.io/qt-4.8/qt-embedded-install.html
There is a guide how to install "Installing Qt for Embedded Linux" Does this mean that this version is for an embedded linux, so it means that it has to be installed on the embedded device. Or does it mean that it guides you how to install QT to develop for a target system and install QT on an other system?
Before i wrote this question, i have already installed QT5.7 from their website. After some googling, i figured out that there are some changes in the windowsystem between 4.8 and 5.x. Since i dont have any GPU and therefore i dont have any OpenGL support, im not sure whether i should better go with 4.8 or whether i could use the 5.x version. Usually i tend to use the latest versions if possible.
Next i saw, that i have to define the sysroot directory. In the sysroot directory there have to be the compiled libs for qt for the arm architecture. Is there a precompiled version of these libs or do i have to compile them by my self? If yes, where to start?
EDIT:
In some tutorials they use the angstrom toolchain with a "qte" suffix My linaro toolchain does not have such an suffix. Is it also possible to use my linaro toolchain to build the qt applications?
Maybe you will notice that im new to QT and to the Embedded Linux world.
Anyhow i hope there are people out there who will be happy to share their knowledge about this topic with me.
Thanks.

Qt Cross Compiling on Mac for EGLFS on Raspberry Pi

I'm trying to create a Qt application that will run embedded on a Raspberry Pi 3. I followed this guide for cross-compiling and was able to run the example qopenglwidget on the Pi correctly. Now my problem is that I would like to build on my Macbook Pro in Qt Creator, but I have no idea how to now deploy to the device. All the guides I've seen online haven't explained what's actually going on and I have no idea how to build a cross compiler on my Mac. Could anyone point me in the right direction about how to do this?
So you have already compiled an example on your mac that runs on your raspberry pi?
This means you already have a cross compiler.
The guide you linked got a prebuild toolchain from https://github.com/raspberrypi/tools
But I think those are only for ubuntu.
When building Qt you need to specify the toolchain in the configure line:
-device-option CROSS_COMPILE=~/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf- \
This is the path to the cross compiler you compile Qt with.
Did this work for you or did you modify this line?
If you want to build a cross compiler yourself you can follow this guide, although I wasn't able to compile Qt with this compiler.
If you have compiled Qt and the examples work on your Pi, you can add a new kit in Qt Creator on your Mac:
Open Qt-Creator -> Preferences:
Under Devices, add a new Generic Linux Device and follow the assistant
Add a new kit, choose a Generic Linux Device as well and specify the device you just added, your compiler you used to build Qt, the debugger if you have built one with you compiler and the Qt Version you compiled.
You should be able to build your project with this kit and it will deploy to your device
Tell us if you were successful.

QT Creator, compiling and deploying a c or c++ to a remote device (BeagleBone or R pi)

I'm trying since days to write and develop programs on my host pc (Ubuntu 64bit) using qt-creator for my beaglebone and raspberry pi devices.
I looked for 'qt-creator cross compile beagle, raspberry etc...' and it leads me to hundred of links and tutorial on how to compile qt-creator for my target plattform. But seriously, that not my idea. All what I want is to simply use my pc for developing my programs and lately deploy them to the remote device.
So first of all a noob question: Is something wrong with my idea? Should I really compile the source of qt for beaglebone or raspberry on my pc for writing programs which lately should be run on that devices????
I will not compile qt-creator again for another plattform, so I don't know how to find the right way. A lot of informations on internet are misleading.
So after many hours spend look for the right information I come up with the following procedure:
first I installed a arm-gnu toolchain on my 64bit Ubuntu.
sudo apt-get install build-essential libc6-armhf-cross libc6-dev-armhf-cross binutils-arm-linux-gnueabihf linux-libc-dev-armhf-cross libstdc++6-armhf-cross gcc-4.8-arm-linux-gnueabihf g++-4.8-arm-linux-gnueabihf
then I installed qt-creator from the repository on my Ubuntu:
sudo apt-get install qtcreator
I tried to configure to use qt for compiling my projects using the toolchain for arm (see following pictures)
and here:
but it seems that qt-creator doesn't recognize the new kit when I start a new project:
Now: I m really confused, I could think that the problem is related to qt, but I m not sure, whether the way of thinking, that I can compile on ubuntu 64bit and then run my application on the remote device is right or not.
For this reason it would be nice if you can answer the question above.
UPDATE: What happen if I add a QT-Version in my Kit???
It happens that the gnueabi compiler conflicts with that options and the following problem arises:
I would like to say again that I don't need to use qt-library or something like that on my remote device. I need just to use the qt-IDE as IDE for my projects (mainly c or c++ plain projects)
You need a complete toolchain
A toolchain is just a name for a group of things:
Compiler for the target platform (or cross compiler in your case)
Sysroot: An image of the filesystem in the target platform
A cross compiling qmake
QtCreator and the kit
You are lacking a cross compiling qmake. Please see my answer at this other post.
Furthermore, you need a toolchain for the Pi, and another toolchain for the Beagle.
It looks like before the update in the question, you didn't even have a valid kit, so there was nothing the IDE could do. You need to create a kit, and set Qt Version to None - because whatever Qt version you have installed is not for the ARM target. So, as long as it'll be none, it should work then, assuming that you have installed a full ARM toolchain for the target, including the Linux-specific bits - since you're not building a bare-bones application, but an application that will run on Linux.
When creating a new project, make sure to select Non-Qt Project, either C or C++, and choose the CMake build system (not qmake or qbs).
To test this out, start with creating a kit for your host platform, without selecting a Qt version (set it to None), and make sure you can create a simple C project and build it (choose proper compilers etc). Once you have done that, you should have an idea how to proceed with building for your ARM Linux targets. It really shouldn't be problematic at all (it all "just works" in my experience), so you probably didn't install something major (related to the target toolchain, nothing to do with Qt nor Qt Creator).
In Derek Molloy's tutorial for the Beaglebone on this subject, he mentions at around minute 18 that installing QT directly through the command sudo apt-get install qtcreator, won't install all the features of the QT app.
Try downloading QT directly from Qt site.

Using KDE in Qt Creator on Windows

I am new to Qt Creator and would like to ask about the configuration of KDE libraries in Qt Creator. I had downloaded Qt 5.2 and would like to use the KDE libraries for some GUI development. In addition,I am currently using Windows 7 OS for my development. I had done a bit of research but I can't really find the KDE libraries for windows. As for configuration method, it is just directing the libraries to the project directory and including commands like this:
LIBS += -lkdeui
in the .pro file?
Thank you everyone for helping.
KDE has a project to port KDE apps in windows. you can find it here http://windows.kde.org/ . You can change your windows appearance to KDE look which is called OXYGEN. if you want to change the look of your application or you want to use other KDE libraries download it and link your application against it. be sure to use the binary that is compiled against your version of Qt.

add qt and qt mobility to my project

I've been reading about qt for some time now and would like to use it to write application for Nokia devices. But there is one thing unclear for me. Let say my aplication uses qt and qt mobility so anyone who would like to install it would have to install qt and qt mobility manually first. Am I getting it right? Or maybe there is a way to add them to my project as static libraries or something...thanks for any help
Nokia Smart Installer eliminates the need for Symbian apps to bundle the Qt framework in distributed SIS files. When an app packaged with Smart Installer is installed, a check is made for the presence of the required Qt packages. If any Qt packages are not present Smart Installer downloads and installs them.
You need download the qt-mobility source code and compile it,
See QtMobility 1.2.2: Installation Guide

Resources