If you haven’t install crosstool-ng you can read this tuto :
https://beter93.wordpress.com/2013/03/20/cross-compilation-with-crosstools-ng-for-raspberry/
Download your Qt lib for linux :
All (old) version available here : ftp://ftp.qt-project.org/qt/source/
Extract it :
tar xvf qt-everywhere-opensource-src-4.6.2.tar.gz
cd qt-everywhere-opensource-src-4.6.2
Now go to :
cd mkspecs/qws
mkdir rasp-g++
cp linux-arm-g++/* rasp-g++
cd rasp-g++
Here, qmake.conf is very important file. On this conf file, you should write the path of your arm g++/gcc compiler.
My qmake.conf file :
#
# qmake configuration for building with arm-linux-gnueabi-g++
#
include(../../common/linux.conf)
include(../../common/gcc-base-unix.conf)
include(../../common/g++-unix.conf)
include(../../common/qws.conf)
MAKEFILE_GENERATOR = UNIX
TARGET_PLATFORM = unix
TEMPLATE = app
CONFIG += qt warn_on release incremental link_prl gdb_dwarf_index
QT += core gui
QMAKE_INCREMENTAL_STYLE = sublib
PATH_ARM = /home/yekmen/x-tools/arm-unknown-linux-gnueabi/bin
#QMAKE_CFLAGS_RELEASE = -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp
#QMAKE_CXXFLAGS_RELEASE = -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp
# modifications to g++.conf
QMAKE_CC = /home/yekmen/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-gcc
QMAKE_CXX = /home/yekmen/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-g++
QMAKE_LINK = /home/yekmen/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-g++
QMAKE_LINK_SHLIB = /home/yekmen/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-g++
# modifications to linux.conf
QMAKE_AR = /home/yekmen/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-ar cqs
QMAKE_OBJCOPY = /home/yekmen/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-objcopy
QMAKE_STRIP = /home/yekmen/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-strip
load(qt_config)
Configure your installation for our lovely Raspberry ❤ :
./configure -lrt -opensource -confirm-license -prefix /opt/qt-arm -no-qt3support -embedded arm -little-endian -xplatform qws/rasp-g++ -fast -no-xinput -no-xrandr -no-openvg -no-opengl -no-gtkstyle -no-nis -no-cups -xmlpatterns -exceptions -no-stl -no-accessibility -no-audio-backend -no-multimedia -no-xfixes -no-mitshm
When your configuration was finished launch make:
make -j4
After 1 or 2 hours … your lib is ready for USE !! If you use make install your lib is here : /opt/qt-arm also, into the lib folder of your qt-evrywhereXXXXX.
Also … you can download my version : (Download Qt for Raspberry )
https://mega.co.nz/#!hhNQ3BZZ!T5KBa3WchTuJ6dOxLHMPp188h4ZcJGDW–tE3ipW634
Enjoy 😉
FAQ:
error1:
libQtCore.so: undefined reference to `QInotifyFileSystemWatcherEngine::create()’
Resolution:
edit ./src/corelib/io/io.pri
find linux-*:
append your cross-toolchain’s prefix after it
Example :
my toolchains’s prefix is arm-unknown-linux-gnueabi-XXX
– 77 linux-*|:!symbian {
+ 77 linux-*| arm-unknown-linux-gnueabi-*:!symbian {
78 SOURCES += \
79 io/qfilesystemwatcher_inotify.cpp \
80 io/qfilesystemwatcher_dnotify.cpp
81
82 HEADERS += \
83 io/qfilesystemwatcher_inotify_p.h \
84 io/qfilesystemwatcher_dnotify_p.h
85 }
86
87 freebsd-*|macx-*|darwin-*|openbsd-*:{
88 SOURCES += io/qfilesystemwatcher_kqueue.cpp
89 HEADERS += io/qfilesystemwatcher_kqueue_p.h
90 }
error2:
libQtCore.so: undefined reference to `clock_gettime’
Resolution:
./configure -lrt
error3:
libQtGui not found :
vim projects.pro
comments : and re lauch ./configure … and make
for(PROJECT, $$list($$lower($$unique(QT_BUILD_PARTS)))) {
isEqual(PROJECT, tools) {
SUBDIRS += tools
} else:isEqual(PROJECT, examples) {
# SUBDIRS += examples
} else:isEqual(PROJECT, demos) {
# SUBDIRS += demos