Skip to main content

Qt 4.6.2 installation procedure for FriendlyARM mini 2440 Linux

This tutorial will provide a simple list of steps necessary to compile and install Qt 4.6.2 on Mini 2440 friendly ARM board. Italian speaking people can read this tutorial on Qt-Italia community website.

The board is equipped with the default GNU/Linux operating system (kernel 2.6.29)

 
This guide has been tested on following GNU/Linux host distributions:
 
CentOS 5.4
Fedora 12
Ubuntu 9.10
 
Some problems were found on following host distributions:
 
Ubuntu 9.04
OpenSUSE 11.2
 
First of all you have to download the GCC toolchain provided by the supplier:
 
 
Now untar the tgz file:
 
tar -xzf arm-linux-gcc-4.3.2.tgz
 
and then copy the directory tree under
 
/usr/local/
 
Remember to export this path on your shell
 
export PATH=/usr/local/arm/4.3.2/bin:$PATH
 
Now we can download Qt
 
 
and untar and unzip the file on a local directory (example:  /home/user)
 
Now, before running the configure tool, you have to modify the qmake.conf file to inform Qt about your toolchain as described here:
 
File: mkspecs/qws/linux-arm-g++/qmake.conf
 
Now change following lines:
 
#QMAKE_CC = arm-linux-gcc
 
#QMAKE_CXX = arm-linux-g++
 
#QMAKE_LINK = arm-linux-g++
 
#QMAKE_LINK_SHLIB = arm-linux-g++
 
with:
 
QMAKE_CC = arm-none-linux-gnueabi-gcc
 
QMAKE_CXX = arm-none-linux-gnueabi-g++
 
QMAKE_LINK = arm-none-linux-gnueabi-g++
 
QMAKE_LINK_SHLIB = arm-none-linux-gnueabi-g++
 
Also change the following lines:
 
#QMAKE_AR = arm-linux-ar cqs
 
#QMAKE_OBJCOPY = arm-linux-objcopy
 
#QMAKE_STRIP = arm-linux-strip
 
with:
 
QMAKE_AR = arm-none-linux-gnueabi-ar cqs
 
QMAKE_OBJCOPY = arm-none-linux-gnueabi-objcopy
 
QMAKE_RANLIB = arm-none-linux-gnueabi–ranlib
 
In order to avoid some illegal instruction on your ARM compiled application binaries, you have to deactivate compiler optimization:
 
File: /mkspecs/common/g++.conf
 
 
Change this line
 
QMAKE_CFLAGS_RELEASE += -O2
 
With:
 
QMAKE_CFLAGS_RELEASE += -O0
 
Now we are ready; in the Qt root subdirectory we run this command:
 
./configure -embedded arm -xplatform qws/linux-arm-g++ -prefix \
 
/usr/local/Qt -qt-mouse-tslib -little-endian -no-webkit -no-qt3support \
 
-no-cups -no-largefile -optimized-qmake -no-openssl -nomake tools
 
And then we can run the command
 
make
 
If everything is ok now we can do
 
make install
 
In order to run our ARM compiled applications we have to set following environment variables on the mini2440 board:
 
export TSLIB_TSEVENTTYPE=INPUT
 
export TSLIB_CONSOLEDEVICE=none
 
export TSLIB_FBDEVICE=/dev/fb0
 
export TSLIB_TSDEVICE=/usr/input/ts
 
export TSLIB_CALIBFILE=/usr/etc/pointercal
 
export TSLIB_CONFFILE=/usr/etc/ts.conf
 
export TSLIB_PLUGINDIR=/usr/lib/ts
 
export LD_LIBRARY_PATH=/usr/local/Qt/lib
 
export QTDIR=/usr/local/Qt
 
export QWS_MOUSE_PROTO=tslib:/usr/input/ts
 
export QWS_DISPLAY=LinuxFB:mmWidth=310:mmHeight=190
 
The Qt library binary (and fonts subdir) shall be placed on a user defined directory of the mini 2440m board and then it is necessary to set LD_LIBRARY_PATH to this directory.
 
Qt binary application must be run with –qws command line argument to inform Qt that we are working on a Linux embedded system.
 
Using the described procedure I was able to compile Qt, qwt library and embedded widgets example.
 
YouTube Video demo: Embedded Widgets example
 
YouTube Video demo: Qwt examples
 
If you have questions you can leave a comment to this post or better, you can post to this forum
 
Good Luck!

It seems env variables and

It seems env variables and export not working for me.

for tslib I create symlink to work.after that I got this error:

/lib/libc.so.6: version `GLIBC_2.9' not found (required by /usr/local/Qt/lib/libQtGui.so.4)

Newbie

"and then copy the directory tree under
 
/usr/local/"
 
does this mean copy the extracted files to the local machine at /usr/local/ ?
Thanks for your input

Re: Newbie

yes

weird html character

hi i copy and pasted the command-line switches and

and besides the extra space the last dash (-) in

QMAKE_RANLIB = arm-none-linux-gnueabi –ranlib

is not a dash.. it's a weird character that looks like a dash.

(could you update the webpage to have "arm-none-linux-gnueabi –ranlib" replaced with "arm-none-linux-gnueabi-ranlib"

it would have saved me an hour or 2)

thanks,

tom

Cannot execute binary file

Hi;

In my ubuntu system, I do you the steps.

I build my application whit QtCreator;
I can run my application on this system? (emulator)

Thanks for you help.

An error accrued when execute ./configure

Hi; :)

the error is :

The tslib functionality test failed!
 You might need to modify the include and library search paths by editing
 QMAKE_INCDIR and QMAKE_LIBDIR in
 /root/qt-src-4.6.3-arm/mkspecs/qws/linux-arm-g++.

 

Thanks.

Hi all, what could be wrong

Hi all,

what could be wrong i have  Ubuntu 10.04 LTS.

i got following error. Any help really glad.
              

Failure to open file: /home/girder/qt-everywhere-opensource-src-4.6.2/config.tests/unix/tslib/Makefile
Unable to generate makefile for: /home/girder/qt-everywhere-opensource-src-4.6.2/config.tests/unix/tslib/tslib.pro
The tslib functionality test failed!
 You might need to modify the include and library search paths by editing
 QMAKE_INCDIR and QMAKE_LIBDIR in
 /home/girder/qt-everywhere-opensource-src-4.6.2/mkspecs/qws/linux-arm-g++.
 

QMAKE_LINK

Hi;

my error because :

QMAKE_LINK = arm-none-linux-gnueabi -g++

replace whit : QMAKE_LINK = arm-none-linux-gnueabi-g++

(whitout space befor -g++)

illegal instruction

Hi paolo,

  My problem is I receive an "illegal instruction" when attempting to run a compiled Qt program.

   Here are the steps I have already followed:

  1) using arm-linux-gcc-4.3.2 tool chain as you state.

   2) Download, and configure as you say to do the qt-everywhere - make and make install

   3) qmake with /usr/local/Qt/bin/qmake on test.pro --- make

    4) send to mini 2440 - export all paths you have mentioned and attempt to run with -qws option ---- illegal instruction here

  Ok - so the only step I did not follow exactly as you said is using tslib since in a post on friendly arm forum it said in case of an error with tslib I can skip that step since qtopia already has the lib installed.

   ---steps I have attemped already :

    1) add into the project MakeFile: -msoft-float -D__GCC_FLOAT_NOT_NEEDED -march=armv4t -mtune=arm920t

  I have added this line on CFLAGS, CXXFLAGS and LFLAGS

When this did not work, I recompiled the Qt everwhere with the QMAKE_CFLAGS = -msoft-float -D__GCC_FLOAT_NOT_NEEDED -march=armv4t -mtune=arm920t

I'm stuck.. what am i missing?  I started to look up which libraries are in QT that require floating point so I could remove them out of the configure but then realized I may need it in the future. thanks for any help.

Did you disable

Did you disable optimization?

I mean did you set this:

QMAKE_CFLAGS_RELEASE += -O0
 
in file /mkspecs/common/g++.conf
 
I received a lot of questions by email or by comments in my previous blog about this topic. I think it's the main problem using ARM, but if you disable optimization and floating point it should work.
 
Another problem I had at the beginning (a very stupid problem) I used FileZilla to transfer by FTP my executable on the board. I forgot to switch FileZilla to binary mode (so I transferred the file as ascii...) and I received an illegal instruction error. 
 
Ok, let me know if you have already disabled optimization then we will try to understand the problem
 
bye
paolo
 
 
 

one more thing..

I am sorry I forgot to include -

 I have also done a file on the compiled program and it says:

 ELF 32-bi LSB executable, ARM, version 1(SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.14, not stripped.  I think that is all .. thank you for your help .

also,

I forgot to include that I have attempted to compile some of the examples and received the same error. thank you.
 

optimized already, using sdcard

Thanks for getting back to me so fast, I double checked the g++.conf file and it was set properly, also I am moving the file through the use of the sdcard.

Paolo

Wow, it's really strange.

I see there are a lot of problems using Qt 4.6.3 with Mini 2440. I'm thinking to build a virtual image (VirtualBox) with my development environment inside a GNU/Linux distribution so people can use it to compile for this board.

This will take some time and I have to find a place to put this 500MB image.

thanks

Just wanted to say thanks for your efforts. :)  I'm at a loss for the moment.

Same problem. Also lost

 

I'm also trying to compile qt for mini 2440 and I have also the illegal instruction problem. I also tried to set all the QMAKE flags to switch the compiler to the correct processor type. I tried this with a sample and it worked. When I compiled the qt library it does not work. In an example project I analyzed  what happened and I found, that the compiler is producing the correct output, but the linker not.  You can check this with the tool "arm-none-linux-genueadbi-readelf -A [executable]. The output should include "v4t".

Then I tried to set Linker switches to fix it. But setting some of them the compilation craches. I'm wondering if there is a global config file to configure the correct arm processor version. I will investigate some more, but my spare time is limited.

Any advice? Thanks Daniel
 

Try this

 

into qmake.conf in mkspecs/qws/linux-arm-g++, add those lines:
 
QMAKE_CFLAGS            += -march=armv4t -mcpu=arm920t
QMAKE_CXXFLAGS += -march=armv4t -mcpu=arm920t
QMAKE_LFLAGS += -march=armv4t -mcpu=arm920t
 
I havent tested but I think you do not have to change Q2 to Q0 in g++.conf if you set this..

Good to know

Thank you for your comment. I will try.

bye

paolo

Voila! It Works:)

Guys,

The steps are perfect.Cross-Compile was successfull .Got QT 4.6.3 working on the FriendlyARM board.Contact me if anyone needs ny help:).

Rahul.

tslib

what can I do for this?

 

/usr/local/Qt/demos/books/books: error while loading shared libraries: libts-0.0.so.0: cannot open shared object file: No such file or directory

Environment variables

How do you set the environment variables on the mini2440?

Environment variables

Hi, I want to know how to change the environment variables in the mini2440. What file do I have to edit?

Environment variables

Hi,

 

Try this link:

http://www.codecoffee.com/tipsforlinux/articles/030.html

 

Regards

paolo