Question

dear all {C++|QT|ARM Processors} developers

Hello

Recently, I'm involved in a QT/ARM Processor software development project. The general components of the project is:

Processor: Mini440 FriendlyARM (400 MHz Samsung S3C2440 ARM926T), 
    www.friendlyarm.net
    www.arm9.net
OS: Linux (Kernel version 2.6.32)
Programming Language: C++ (GCC/g++)
GUI Framework: QT

The main purpose of the project is to develop a GUI for the embedded handheld device, using QT/Embedded Linux.

The output of command uname -a on host computer (development machine) is:

$ uname -a

Linux scorpion 3.5.0-39-generic #60~precise1-Ubuntu SMP Wed Aug 14 15:38:41 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

The output of command uname -a on embedded ARM-based device is:

Liunx FriendlyARM 2.6.32-FriendlyARM #5 Wed Jun 6 15:50:50 HKT 2012 armv4tl unknown.

My first question is:

Q. Is it important to host and target computers have the same architecture, I mean both should be 32-bits (x86 or i586/i686) or both should be 64-bits (x86_64)?

I did the following steps:

  1. I wrote a simple GUI using QT Creator (2.7.0) based on QT Designer (5.0.2) on a desktop Linux machine (host computer)

  2. Based on knowledge, I gained in last two months from books and Intenet about Cross-compiling, and Tool-chain and other many many related concepts, I found I have to install another software from Trolltech called Qtopia, the Embedded version of QT. I tries to install the latest version of Qtopia called qtopia-core-opensource-src-4.3.5 at this point I had a lot of problems at configuration, building and making the software. One problem is g++ on host is 4.8.1 (very new), but the Qtopia is for about 7 years ago. When I tries to build the Qtopia from source the g++ compiler issues several C++ errors, for example:

    error: 'ptrdiff_t' does not name a type error: 'append' was not declared in this scope, and no declaration, where found by argument-dependent lookup

Of course, I solved these problems, but it's obvious g++ issues these errors because Qtopia was written using C++98, but g++ 4.8.1 is based on C++11 my questions are:

Q. Is it important to use which version of GCC with Qtopia? another thing is which version of QT/Embedded should be used?

Q. Do I have to use the old versions of QT/Embedded like Qtopia or I can use the newer versions like qt-everywhere-opensource-src-4.8.4?

another problem is about kernel version: is it important Q. Is it important to host and target computers have the same kernel number (x.y.z)?

As you can see, I lost in details of cross-compiling and porting written software from host to embedded device. I almost have no problem in using QT and writing C++ in desktop version. At last, I appreciate you to give a your general but practical guideline/tips to cross-compiling from x86 GCC to FreindlyARM platform.

Please shed some light

TIA

Saeed Amrollahi Boyouki

Was it helpful?

Solution

Q. Is it important to host and target computers have the same architecture, I mean both should be 32-bits (x86 or i586/i686) or both should be 64-bits (x86_64)?

No, you can any variation, although I have never seen 32 bit host and 64 bit target. The other combination should just work according to my knowledge.

Q. Is it important to use which version of GCC with Qtopia? another thing is which version of QT/Embedded should be used?

Yes, it is important. Do not mix old and new softwares because they will not fit nicely together.

Q. Do I have to use the old versions of QT/Embedded like Qtopia or I can use the newer versions like qt-everywhere-opensource-src-4.8.4?

No. In fact, do not use Qtopia the ancient, try to use a recent Qt release like Qt 5.2. The reason is simply the fact that is design flaws, and it gets no maintenance these days.

another problem is about kernel version: is it important Q. Is it important to host and target computers have the same kernel number (x.y.z)?

No, it is almost always different, actually. That is due to the fact that there are so many varieties of the Linux kernel out there, used by different distributions or distribution generators.

At last, I appreciate you to give a your general but practical guideline/tips to cross-compiling from x86 GCC to FreindlyARM platform.

If you want to build Qt on your own for your target, you will need to pay attention to the -platform and -xplatform options. The former defines your host platform, and the latter the embedded target platform.

Basically, you need to make qmake has proper support for your board in form of mkspecs files. If it does not, it is relatively easy to get one from scratch based on the existing ones.

When you build your software for the embedded board, you will need to use the -spec option in a qmake based project to select the right target.

I would also suggest to give some consideration to QtCreator as a newcomer where you can properly configure the "kits", and customize the deployment steps, etc. It has a lot of builtin cross-toolchain development support.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top