PDA

View Full Version : Compiling qt 5.4 for raspberry



dram
4th February 2015, 22:04
Hello.

I'm trying to compile QT 5.4 to use cross-compile on rasp (512 mb)

My configure command:

./configure -opengl es2 -qpa eglfs -device rasp-pi -device-option CROSS_COMPILE=$BDIR/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf- -sysroot /mnt/rpi-rootfs -opensource -confirm-license -optimized-qmake -reduce-exports -release -nomake tests -prefix /opt/qt5-rpi -no-pch -skip qttools


Configure finish ok:


Running configuration tests...
Note: PKG_CONFIG_LIBDIR automatically set to /mnt/rpi-rootfs/usr/lib/pkgconfig:/mnt/rpi-rootfs/usr/share/pkgconfig:/mnt/rpi-rootfs/usr/lib/arm-linux-gnueabihf/pkgconfig
Note: PKG_CONFIG_SYSROOT_DIR automatically set to /mnt/rpi-rootfs
Warning: Disabling Linux Accessibility Bridge: DBus is missing.

Configure summary

Building on: linux-g++ (x86_64, CPU features: mmx sse sse2)
Building for: devices/linux-rasp-pi-g++ (arm, CPU features: none detected)
Platform notes:

- Also available for Linux: linux-kcc linux-icc linux-cxx

Build options:
Configuration .......... accessibility alsa audio-backend c++11 clock-gettime clock-monotonic compile_examples concurrent cross_compile egl eglfs evdev eventfd freetype full-config getaddrinfo getifaddrs glib harfbuzz iconv inotify ipv6ifname large-config largefile linuxfb medium-config minimal-config mremap nis opengl opengles2 pcre png posix_fallocate qpa qpa reduce_exports release rpath shared small-config system-zlib use_gold_linker xcb xcb-glx xcb-plugin xcb-render xcb-xlib xkbcommon-qt
Build parts ............ libs examples
Mode ................... release
Using C++11 ............ yes
Using gold linker....... yes
Using PCH .............. no
Target compiler supports:
Neon ................. auto

Qt modules and options:
Qt D-Bus ............... no
Qt Concurrent .......... yes
Qt GUI ................. yes
Qt Widgets ............. yes
Large File ............. yes
QML debugging .......... yes
Use system proxies ..... no

Support enabled for:
Accessibility .......... yes
ALSA ................... yes
CUPS ................... no
Evdev .................. yes
FontConfig ............. no
FreeType ............... yes (bundled copy)
Glib ................... yes
GTK theme .............. no
HarfBuzz ............... yes (bundled copy)
Iconv .................. yes
ICU .................... no
Image formats:
GIF .................. yes (plugin, using bundled copy)
JPEG ................. yes (plugin, using bundled copy)
PNG .................. yes (in QtGui, using bundled copy)
journald ............... no
mtdev .................. no
Networking:
getaddrinfo .......... yes
getifaddrs ........... yes
IPv6 ifname .......... yes
OpenSSL .............. no
NIS .................... yes
OpenGL / OpenVG:
EGL .................. yes
OpenGL ............... yes (OpenGL ES 2.0+)
OpenVG ............... no
PCRE ................... yes (bundled copy)
pkg-config ............. yes
PulseAudio ............. no
QPA backends:
DirectFB ............. no
EGLFS ................ yes
KMS .................. no
LinuxFB .............. yes
XCB .................. yes (system library)
EGL on X ........... no
GLX ................ yes
MIT-SHM ............ yes
Xcb-Xlib ........... yes
Xcursor ............ yes (loaded at runtime)
Xfixes ............. yes (loaded at runtime)
Xi ................. yes (loaded at runtime)
Xi2 ................ no
Xinerama ........... yes (loaded at runtime)
Xrandr ............. yes (loaded at runtime)
Xrender ............ no
XKB ................ no
XShape ............. yes
XSync .............. yes
XVideo ............. yes
Session management ..... yes
SQL drivers:
DB2 .................. no
InterBase ............ no
MySQL ................ no
OCI .................. no
ODBC ................. no
PostgreSQL ........... no
SQLite 2 ............. no
SQLite ............... yes (plugin, using bundled copy)
TDS .................. no
udev ................... no
xkbcommon .............. yes (bundled copy, XKB config root: /usr/share/X11/xkb)
zlib ................... yes (system library)

After this i make "make -j4 finish"

While compiling the result is error:



/home/dram/src/rpi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld.gold: error: cannot find -lqtharfbuzzng
.obj/qfontengine.o:qfontengine.cpp:function QFontEngine::supportsScript(QChar::Script) const: error: undefined reference to 'hb_ot_tags_from_script'
.obj/qfontengine.o:qfontengine.cpp:function QFontEngine::supportsScript(QChar::Script) const: error: undefined reference to 'hb_ot_layout_table_find_script'
.obj/qfontengine.o:qfontengine.cpp:function QFontEngine::supportsScript(QChar::Script) const: error: undefined reference to 'hb_ot_layout_table_find_script'
.obj/qfontengine.o:qfontengine.cpp:function QFontEngine::supportsScript(QChar::Script) const: error: undefined reference to 'hb_ot_layout_table_find_script'
.obj/qtextengine.o:qtextengine.cpp:function QTextEngine::shapeTextWithHarfbuzzNG(QScriptItem const&, unsigned short const*, int, QFontEngine*, QVector<unsigned int> const&, bool) const: error: undefined reference to 'hb_buffer_create'
.obj/qtextengine.o:qtextengine.cpp:function QTextEngine::shapeTextWithHarfbuzzNG(QScriptItem const&, unsigned short const*, int, QFontEngine*, QVector<unsigned int> const&, bool) const: error: undefined reference to 'hb_buffer_set_unicode_funcs'
.obj/qtextengine.o:qtextengine.cpp:function QTextEngine::shapeTextWithHarfbuzzNG(QScriptItem const&, unsigned short const*, int, QFontEngine*, QVector<unsigned int> const&, bool) const: error: undefined reference to 'hb_buffer_pre_allocate'
.obj/qtextengine.o:qtextengine.cpp:function QTextEngine::shapeTextWithHarfbuzzNG(QScriptItem const&, unsigned short const*, int, QFontEngine*, QVector<unsigned int> const&, bool) const: error: undefined reference to 'hb_buffer_allocation_successful'
.obj/qtextengine.o:qtextengine.cpp:function QTextEngine::shapeTextWithHarfbuzzNG(QScriptItem const&, unsigned short const*, int, QFontEngine*, QVector<unsigned int> const&, bool) const: error: undefined reference to 'hb_buffer_clear_contents'
.obj/qtextengine.o:qtextengine.cpp:function QTextEngine::shapeTextWithHarfbuzzNG(QScriptItem const&, unsigned short const*, int, QFontEngine*, QVector<unsigned int> const&, bool) const: error: undefined reference to 'hb_buffer_add_utf16'
.obj/qtextengine.o:qtextengine.cpp:function QTextEngine::shapeTextWithHarfbuzzNG(QScriptItem const&, unsigned short const*, int, QFontEngine*, QVector<unsigned int> const&, bool) const: error: undefined reference to 'hb_buffer_set_segment_properties'


I have tried install a lot of packages contains harfbuzz but still the same error.

Any idea?

acracan
5th February 2015, 08:05
I have the same issue. As you can see in your 'config.log', qt will use the bundled copy of harfbuzz (actually harfbuzz-ng). Yet, it seems that for some reason it doesn't compile harfbuzz-ng when one runs 'make'.
I went to qt-everywhere-opensource-src-5.4.0/qtbase/src/3rdparty/harfbuzz-ng and manually ran 'make' and harfbuzz-ng compiled. Afterwards I went back to qt-everywhere-opensource-src-5.4.0 and ran 'make' again. It got past the errors with 'harfbuzz', but my build now fails with the error:
Makefile:57: recipe for target 'sub-src-install_subtargets' failed
make[1]: *** [sub-src-install_subtargets] Error 2

acracan
5th February 2015, 12:37
It looks like you have to compile using the following sequence of commands:
$ make
$ make install

When trying directly with 'make install' my compile failed with the above mentioned 'harfbuzz' errors. Probably your 'make finish' did the same.

You also have to make sure you have correctly configured pkg-config. The error I was seeing previously was due to qt not finding dbus headers because I didn't correctly configure pkg-config.
To correctly configure pkg-config I did the following before running ./configure:
SYSROOT=/mnt/rpi-rootfs
export PKG_CONFIG_DIR=
export PKG_CONFIG_SYSROOT_DIR=$SYSROOT
export PKG_CONFIG_LIBDIR=$SYSROOT/usr/lib/arm-linux-gnueabihf/pkgconfig/:$SYSROOT/usr/share/pkgconfig:$SYSROOT/usr/lib/pkgconfig
export PKG_CONFIG_PATH=$SYSROOT/usr/lib/arm-linux-gnueabihf/pkgconfig/:$SYSROOT/usr/share/pkgconfig:$SYSROOT/usr/lib/pkgconfig

With these settings I was able to successfully build and install Qt 5.4. Hope this helps.

dram
8th February 2015, 09:05
Oh of course, i didn't make 'make -j4 finish' , but 'make -j4 install'


After you advices, i mean:

'make
make install'

QT compiled fine.

But i have second problem with qt creator and cross compile

I add a kit, my device (raspberry), but after compile i have got a error

'Can not found a command' ( if i want to run my program on rasp)

dram
12th February 2015, 22:58
~refresh :)

dram
15th February 2015, 23:21
~refresh +

FULL command : "Can not run : you have not entered a command"