Qt cross compile for Raspbian Jessie



  • I am facing problem to compile svg and qtquick modules to cross compile for raspbian jessie. can any one have tried qt crossed compilation for jessie ??


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    What problem are you facing ?



  • I was trying https://wiki.qt.io/RaspberryPi_Beginners_Guide with jessie and latest qt from repo...
    Till the point Compiling other modules I was successful without any big problem. In module compilation I can compile imageformat. But than in svg module i am facing problem.

    /home/gcc-4.7-linaro-rpi-gnueabihf/bin/arm-linux-gnueabihf-g++ -c -include .pch/Qt5Svg -pipe -marm -mfpu=vfp -mtune=arm1176jzf-s -march=armv6zk -mabi=aapcs-linux -mfloat-abi=hard --sysroot=/mnt/rasp-pi-rootfs -O2 -std=c++0x -fvisibility=hidden -fvisibility-inlines-hidden -fno-exceptions -Wall -W -D_REENTRANT -fPIC -DQT_NO_MTDEV -DQT_NO_LIBUDEV -DQT_NO_TSLIB -DQT_NO_LIBINPUT -DQT_NO_USING_NAMESPACE -DQT_BUILD_SVG_LIB -DQT_BUILDING_QT -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x050000 -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -I. -I../../include -I../../include/QtSvg -I../../include/QtSvg/5.6.0 -I../../include/QtSvg/5.6.0/QtSvg -I/mnt/rasp-pi-rootfs/usr/local/qt5pi/include/QtCore/5.6.0 -I/mnt/rasp-pi-rootfs/usr/local/qt5pi/include/QtCore/5.6.0/QtCore -I/mnt/rasp-pi-rootfs/usr/local/qt5pi/include/QtGui/5.6.0 -I/mnt/rasp-pi-rootfs/usr/local/qt5pi/include/QtGui/5.6.0/QtGui -I/mnt/rasp-pi-rootfs/usr/local/qt5pi/include -I/mnt/rasp-pi-rootfs/usr/local/qt5pi/include/QtGui -I/mnt/rasp-pi-rootfs/usr/local/qt5pi/include/QtCore -I.moc -I/mnt/rasp-pi-rootfs/opt/vc/include -I/mnt/rasp-pi-rootfs/opt/vc/include/interface/vcos/pthreads -I/mnt/rasp-pi-rootfs/opt/vc/include/interface/vmcs_host/linux -I/usr/local/qt5pi/mkspecs/devices/linux-rasp-pi-g++ -o .obj/moc_qsvgwidget.o .moc/moc_qsvgwidget.cpp
    qgraphicssvgitem.h:53: Error: Undefined interface
    Makefile:1174: recipe for target '.moc/moc_qgraphicssvgitem.cpp' failed
    make[2]: *** [.moc/moc_qgraphicssvgitem.cpp] Error 1
    make[2]: *** Waiting for unfinished jobs....
    In file included from .moc/moc_qsvgwidget.cpp:9:0:
    .moc/../qsvgwidget.h:41:31: fatal error: QtWidgets/qwidget.h: No such file or directoryIn file included from qsvgwidget.cpp:34:0:
    qsvgwidget.h:41:31: fatal error: QtWidgets/qwidget.h: No such file or directory

    compilation terminated.

    This is my error text.


  • Lifetime Qt Champion

    Are you sure /mnt/rasp-pi-rootfs/usr/local/qt5pi/includeis accessible ?



  • Also my question is from qt5.2 jsondb and jsbackend modules are removed. So do i need them separately or their support wll be provided in some othr module.



  • @SGaist Ya it is accessible.. Hence i can compile and install imageformat module without any issue.


  • Lifetime Qt Champion

    jsondb and jsbackend ? Where did you had them ?

    Can you locate qwidget.h in /mnt/rasp-pi-rootfs/usr/local/qt5pi/include ?



  • No i dont have tht file in /include path..How come ?? Does ths mean my qtbase is not installed properly


  • Lifetime Qt Champion

    Looks like it, what option did you give to configure ?



  • @SGaist ./configure -opengl es2 -device linux-rasp-pi-g++ -device-option CROSS_COMPILE=~/opt/gcc-4.7-linaro-rpi-gnueabihf/bin/arm-linux-gnueabihf- -sysroot /mnt/rasp-pi-rootfs -opensource -confirm-license -optimized-qmake -reduce-exports -release -make libs -prefix /usr/local/qt5pi -hostprefix /usr/local/qt5pi
    same as mentioned in http://wiki.qt.io/Raspberrypi_beginners_guide


  • Lifetime Qt Champion

    That looks correct, do you have the configure summary ?



  • @SGaist

    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-clang linux-kcc linux-icc linux-cxx
    

    Build options:
    Configuration .......... accessibility audio-backend c++11 clock-gettime clock-monotonic compile_examples concurrent cross_compile dbus egl eglfs eglfs_brcm enable_new_dtags evdev eventfd freetype full-config getaddrinfo getifaddrs harfbuzz iconv inotify ipv6ifname large-config largefile linuxfb medium-config minimal-config mremap nis opengl opengles2 pcre png posix_fallocate precompile_header qpa qpa reduce_exports release rpath shared small-config system-png system-zlib threadsafe-cloexec
    Build parts ............ libs
    Mode ................... release
    Using sanitizer(s)...... none
    Using C++ standard ..... c++11
    Using gold linker....... no
    Using new DTAGS ........ yes
    Using PCH .............. yes
    Target compiler supports:
    Neon ................. no

    Qt modules and options:
    Qt D-Bus ............... yes (loading dbus-1 at runtime)
    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 ................... no
    CUPS ................... no
    Evdev .................. yes
    FontConfig ............. no
    FreeType ............... yes (bundled copy)
    Glib ................... no
    GStreamer .............. no
    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 system library)
    libinput................ no
    Logging backends:
    journald ............... no
    syslog ............... no
    mtdev .................. no
    Networking:
    getaddrinfo .......... yes
    getifaddrs ........... yes
    IPv6 ifname .......... yes
    libproxy.............. no
    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
    EGLFS i.MX6....... . no
    EGLFS KMS .......... no
    EGLFS Mali ......... no
    EGLFS Raspberry Pi . yes
    EGLFS X11 .......... no
    LinuxFB .............. yes
    Mir client............ no
    XCB .................. no
    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
    tslib .................. no
    udev ................... no
    xkbcommon-x11........... no
    xkbcommon-evdev......... no
    zlib ................... yes (system library)

    NOTE: Qt is using double for qreal on this system. This is binary incompatible against Qt 5.1.
    Configure with '-qreal float' to create a build that is binary compatible with 5.1.


  • Lifetime Qt Champion

    Looks good…

    Might be a glitch when you ran make install



  • @SGaist I tries some stuff but not able to fix it. Can u guide me how to fix this and wht could be reason for this ??


  • Lifetime Qt Champion

    Well, basically and if I understood you correctly, you are able to cross-compile without any problem, correct ? When calling make install did you have the root file system of the Pi mounted correctly ?



  • @SGaist I checked install log properly it should make QtWidget, QtPlateformHeaders, QtPlateformSupport, QtTest, QtOpenGL, QtPrintSupport, QtConcurrent, QtCore, QtDBus, QtGui, QtNetwork , QtPositioning, QtScript, QtSensors, QtSql , QtXml , QtXmlPatterns folders. But after finishing installation i m getting only QtConcurrent, QtCore, QtDBus, QtGui, QtNetwork , QtPositioning, QtScript, QtSensors, QtSql , QtXml , QtXmlPatterns folders in my install and similar in lib directory. So it cant install QtWidget, QtPlateformHeaders, QtPlateformSupport, QtTest, QtOpenGL, QtPrintSupport modules. I did nt find anything unusual in log.


  • Lifetime Qt Champion

    Did you build only qtbase or all of Qt ?



  • well according to https://wiki.qt.io/RaspberryPi_Beginners_Guide i have to build and install qtbase and than other modules. So I could not finish this step and I am blocked.


  • Lifetime Qt Champion

    That's correct. Do you have libQtWidget.so somewhere in your build folder ?



  • @SGaist Nope...


  • Lifetime Qt Champion

    That one's really puzzling…

    What happens if you call make -C src/widgets in your builder ?



  • Hi @SGaist ,
    I dont know what exactly was the problem. But I re cloned repo and than tried all steps and it works as expected. Could be a problem of broken download. But it neither gave me any unexpected error message not it failed. :P
    But now i m happy tht i wll have kernel 4.1 with qt in my pi.. thanks for your time and support man.


  • Lifetime Qt Champion

    Well, that was a good idea !

    You're welcome !

    Since you have it working now, please mark the thread as solved using the "Topic Tool" button so other forum users may know a solution has been found :)


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.