Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

RaspberryPi3 Crosscompiling on Windows Error



  • Hello there!
    First of all sorry for my English, is not my language, and im a little bit new on crosscompilation.

    Im trying (from two weeks ago) to crosscompile Qt 5.13.2 on Windows to a Raspberry Pi3 with raspbian-stretch-full.
    I have been following a lot of guides along the internet and i tried a lot of methods but i definetively cannot solve the problem Im facing right now.

    Im running the commands on msys2 prompt, so im launching linux commands. Right now the configure operation seems to be correct but on make operation im facing the following error:

    C:/SysGCC/Raspberry/bin/arm-linux-gnueabihf-g++ -mfloat-abi=hard --sysroot=C:/SysGCC/Raspberry/arm-linux-gnueabihf/sysroot -Wl,--no-undefined -Wl,-O1 -Wl,--enable-new-dtags -Wl,-z,origin -Wl,-rpath,$ORIGIN/../../lib -Wl,-rpath-link,C:/SysGCC/Raspberry/arm-linux-gnueabihf/sysroot/opt/vc/lib -Wl,-rpath-link,C:/SysGCC/Raspberry/arm-linux-gnueabihf/sysroot/usr/lib/arm-linux-gnueabihf -Wl,-rpath-link,C:/SysGCC/Raspberry/arm-linux-gnueabihf/sysroot/lib/arm-linux-gnueabihf -shared -o libqeglfs-brcm-integration.so .obj/qeglfsbrcmmain.obj .obj/qeglfsbrcmintegration.obj -L=/opt/vc/lib -lbcm_host D:/Qt/qtbuild/qtbase/lib/libQt5EglFSDeviceIntegration.so D:/Qt/qtbuild/qtbase/lib/libQt5EventDispatcherSupport.a D:/Qt/qtbuild/qtbase/lib/libQt5ServiceSupport.a D:/Qt/qtbuild/qtbase/lib/libQt5ThemeSupport.a D:/Qt/qtbuild/qtbase/lib/libQt5FontDatabaseSupport.a C:/SysGCC/Raspberry/arm-linux-gnueabihf/sysroot/usr/lib/arm-linux-gnueabihf/libfontconfig.so C:/SysGCC/Raspberry/arm-linux-gnueabihf/sysroot/usr/lib/arm-linux-gnueabihf/libfreetype.so C:/SysGCC/Raspberry/arm-linux-gnueabihf/sysroot/usr/lib/arm-linux-gnueabihf/libz.so D:/Qt/qtbuild/qtbase/lib/libQt5FbSupport.a D:/Qt/qtbuild/qtbase/lib/libQt5EglSupport.a C:/SysGCC/Raspberry/arm-linux-gnueabihf/sysroot/opt/vc/lib/libbrcmEGL.so D:/Qt/qtbuild/qtbase/lib/libQt5InputSupport.a D:/Qt/qtbuild/qtbase/lib/libQt5PlatformCompositorSupport.a D:/Qt/qtbuild/qtbase/lib/libQt5Gui.so D:/Qt/qtbuild/qtbase/lib/libQt5DeviceDiscoverySupport.a D:/Qt/qtbuild/qtbase/lib/libQt5DBus.so D:/Qt/qtbuild/qtbase/lib/libQt5Core.so C:/SysGCC/Raspberry/arm-linux-gnueabihf/sysroot/opt/vc/lib/libbrcmGLESv2.so -lpthread C:/SysGCC/Raspberry/arm-linux-gnueabihf/sysroot/usr/lib/arm-linux-gnueabihf/libdl.so C:/SysGCC/Raspberry/arm-linux-gnueabihf/sysroot/opt/vc/lib/libbrcmEGL.so C:/SysGCC/Raspberry/arm-linux-gnueabihf/sysroot/opt/vc/lib/libbrcmGLESv2.so
    c:/sysgcc/raspberry/bin/../lib/gcc/arm-linux-gnueabihf/6/../../../../arm-linux-gnueabihf/bin/ld.exe: cannot find -lbcm_host
    collect2.exe: error: ld returned 1 exit status
    make[7]: *** [Makefile:125: ../../../../../../plugins/egldeviceintegrations/libqeglfs-brcm-integration.so] Error 1
    make[7]: se sale del directorio '/d/Qt/qtbuild/qtbase/src/plugins/platforms/eglfs/deviceintegration/eglfs_brcm'
    make[6]: *** [Makefile:48: sub-eglfs_brcm-make_first] Error 2
    make[6]: se sale del directorio '/d/Qt/qtbuild/qtbase/src/plugins/platforms/eglfs/deviceintegration'
    make[5]: *** [Makefile:107: sub-deviceintegration-make_first-ordered] Error 2
    make[5]: se sale del directorio '/d/Qt/qtbuild/qtbase/src/plugins/platforms/eglfs'
    make[4]: *** [Makefile:128: sub-eglfs-make_first] Error 2
    make[4]: se sale del directorio '/d/Qt/qtbuild/qtbase/src/plugins/platforms'
    make[3]: *** [Makefile:105: sub-platforms-make_first] Error 2
    make[3]: se sale del directorio '/d/Qt/qtbuild/qtbase/src/plugins'
    make[2]: *** [Makefile:804: sub-plugins-make_first] Error 2
    make[2]: se sale del directorio '/d/Qt/qtbuild/qtbase/src'
    make[1]: *** [Makefile:51: sub-src-make_first] Error 2
    make[1]: se sale del directorio '/d/Qt/qtbuild/qtbase'
    make: *** [Makefile:83: module-qtbase-make_first] Error 2

    This file exists on the path C:\SysGCC\raspberry\arm-linux-gnueabihf\sysroot\opt\vc\include but i dont know why it cannot find it.
    I have tried adding on the file D:\Qt\5.13.2-src\qtbase\mkspecs\devices\linux-rasp-pi3-g++\qmake.conf the following lines but dont works.

    INCLUDEPATH += $$[QT_SYSROOT]/opt/vc/include
    INCLUDEPATH += $$[QT_SYSROOT]/opt/vc/include/interface/vcos
    INCLUDEPATH += $$[QT_SYSROOT]/opt/vc/include/interface/vcos/pthreads
    INCLUDEPATH += $$[QT_SYSROOT]/opt/vc/include/interface/vmcs_host/linux

    I dont know if could be related but I also tried to change on the same file -lEGL to -lbrcmEGL and -LGLESv2 to -lbrcmGLESv2, but i dont really know if i have to do it. I have read in much guides i have to change but in my sysroot actually i have C:\SysGCC\raspberry\arm-linux-gnueabihf\sysroot\opt\vc\include\EGL, C:\SysGCC\raspberry\arm-linux-gnueabihf\sysroot\opt\vc\include\GLES and C:\SysGCC\raspberry\arm-linux-gnueabihf\sysroot\opt\vc\include\GLES2.

    I also tried adding on the configuration call -L /opt/vc/lib but dont works too. My configuration script is :

    export QTVER=5.13.2
    cd qtbuild
    ../$QTVER-src/configure -release -opengl es2 -platform win32-g++ -device linux-rasp-pi3-g++ -device-option CROSS_COMPILE=C:/SysGCC/Raspberry/bin/arm-linux-gnueabihf- -sysroot C:/SysGCC/Raspberry/arm-linux-gnueabihf/sysroot -opensource -confirm-license -skip qtwayland -skip qtlocation -skip qtscript -make libs -prefix /home/pi/$QTVER-cross -extprefix $PWD//../$QTVER-cross -hostprefix $PWD/../$QTVER -no-use-gold-linker -v -no-gbm -L /opt/vc/lib

    I dont find anything more i can check ... ¿any idea?

    Thanks in advance.
    Pablo.

    EDIT: Finally i found the solution, i dont know why but the Makefile created is wrong, once you have configured the compilation you have to go to your_path_where_you_configure_qt\qtbase\src\plugins\platforms\eglfs\deviceintegration\eglfs_brcm, open the Makefile and search the line where sets the LIBS value. On this line, change "-lbcm_host" to "path_to_your_sysroot/opt/vc/lib/libbcm_host.so". ¡Now is compiling!
    It seems to be that the .so file have a different name that the expected by qt.
    I hope it could helps someone.


  • Moderators

    Cross-compilation is hard and often breaks. It is usually easier to do on Linux host. If you are facing errors and can't solve them for so long, I suggest trying cross compiling from Linux to Raspberry Pi instead. You can install Ubuntu or something on a virtual machine if you don't want to pollute your dev machine.



  • Hello sierdzio, thanks for your answer.

    Im also trying in parallel compiling over Ubuntu on a virtual machine, and seems to be correctly configured, but when i run make im getting a lot of errors on qquicktableview.cpp and I dont know how i can solver it:

    The configure call is (i run it on qtbuild as you do on one of your scripts i found):

    ../5.12.0-src/configure -release -opengl es2 -device linux-rasp-pi-g++ -device-option CROSS_COMPILE=~/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf- -sysroot ~/raspi/sysroot -opensource -confirm-license -skip qtwayland -skip qtlocation -skip qtscript -make libs -prefix /usr/local/qt5pi -extprefix ~/raspi/qt5pi -hostprefix ~/raspi/qt5 -no-use-gold-linker -v -no-gbm

    And the errors (some of them, there are too much to paste here)

    /home/praposo/raspi/5.12.0-src/qtdeclarative/src/quick/items/qquicktableview.cpp: In member function ‘void QQuickTableViewPrivate::connectToModel()’:
    /home/praposo/raspi/5.12.0-src/qtdeclarative/src/quick/items/qquicktableview.cpp:1650:131: error: no matching function for call to ‘QQuickTableViewPrivate::connect(QPointer<QQmlTableInstanceModel>&, void (QQmlTableInstanceModel::)(int, QObject), QQuickTableViewPrivate* const, void (QQuickTableViewPrivate::)(int, QObject))’
    QObjectPrivate::connect(tableModel, &QQmlTableInstanceModel::itemPooled, this, &QQuickTableViewPrivate::itemPooledCallback);
    .....
    /home/praposo/raspi/5.12.0-src/qtbase/include/QtCore/5.12.0/QtCore/private/../../../../../src/corelib/kernel/qobject_p.h:327:32: note: template<class Func1, class Func2> static QMetaObject::Connection QObjectPrivate::connect(const typename QtPrivate::FunctionPointer<Func>::Object*, Func1, const typename QtPrivate::FunctionPointer<Func2>::Object*, Func2, Qt::ConnectionType)
    inline QMetaObject::Connection QObjectPrivate::connect(const typename QtPrivate::FunctionPointer<Func1>::Object sender, Func1 signal,
    ^
    /home/praposo/raspi/5.12.0-src/qtbase/include/QtCore/5.12.0/QtCore/private/../../../../../src/corelib/kernel/qobject_p.h:327:32: note: template argument deduction/substitution failed:
    /home/praposo/raspi/5.12.0-src/qtdeclarative/src/quick/items/qquicktableview.cpp:1650:131: note: mismatched types ‘const typename QtPrivate::FunctionPointer<Func>::Object
    ’ and ‘QPointer<QQmlTableInstanceModel>’
    QObjectPrivate::connect(tableModel, &QQmlTableInstanceModel::itemPooled, this, &QQuickTableViewPrivate::itemPooledCallback);
    .....
    /home/praposo/raspi/5.12.0-src/qtbase/include/QtCore/5.12.0/QtCore/private/../../../../../src/corelib/kernel/qobject_p.h:225:36: note: static QMetaObject::Connection QObjectPrivate::connect(const QObject*, int, QtPrivate::QSlotObjectBase*, Qt::ConnectionType)
    static QMetaObject::Connection connect(const QObject sender, int signal_index, QtPrivate::QSlotObjectBase slotObj, Qt::ConnectionType type);
    ^
    /home/praposo/raspi/5.12.0-src/qtbase/include/QtCore/5.12.0/QtCore/private/../../../../../src/corelib/kernel/qobject_p.h:225:36: note: no known conversion for argument 2 from ‘void (QQmlTableInstanceModel::
    )(int, QObject
    )’ to ‘int’
    /home/praposo/raspi/5.12.0-src/qtdeclarative/src/quick/items/qquicktableview.cpp:1651:131: error: no matching function for call to ‘QQuickTableViewPrivate::connect(QPointer<QQmlTableInstanceModel>&, void (QQmlTableInstanceModel::)(int, QObject), QQuickTableViewPrivate* const, void (QQuickTableViewPrivate::)(int, QObject))’
    QObjectPrivate::connect(tableModel, &QQmlTableInstanceModel::itemReused, this, &QQuickTableViewPrivate::itemReusedCallback);
    ....
    /home/praposo/raspi/5.12.0-src/qtbase/include/QtCore/5.12.0/QtCore/private/../../../../../src/corelib/kernel/qobject_p.h:327:32: note: template<class Func1, class Func2> static QMetaObject::Connection QObjectPrivate::connect(const typename QtPrivate::FunctionPointer<Func>::Object*, Func1, const typename QtPrivate::FunctionPointer<Func2>::Object*, Func2, Qt::ConnectionType)
    inline QMetaObject::Connection QObjectPrivate::connect(const typename QtPrivate::FunctionPointer<Func1>::Object sender, Func1 signal,
    ^
    /home/praposo/raspi/5.12.0-src/qtbase/include/QtCore/5.12.0/QtCore/private/../../../../../src/corelib/kernel/qobject_p.h:327:32: note: template argument deduction/substitution failed:
    /home/praposo/raspi/5.12.0-src/qtdeclarative/src/quick/items/qquicktableview.cpp:1651:131: note: mismatched types ‘const typename QtPrivate::FunctionPointer<Func>::Object
    ’ and ‘QPointer<QQmlTableInstanceModel>’
    QObjectPrivate::connect(tableModel, &QQmlTableInstanceModel::itemReused, this, &QQuickTableViewPrivate::itemReusedCallback);

    I tried with qt5.12.0 and qt13.2 and Im facing the same error, so I think could be something in my compilers, but i dont really know. ¿Could you help me?

    Thanks a lot in advance.


  • Moderators

    Sorry, I don't know this error. The only thing that looks odd is that you use linux-rasp-pi-g++ which is mkspec for the first Raspberry Pi. You most probably are compiling for a newer RPi. But that has probably no relation to the compilation bug you are seeing.



  • @sierdzio Thanks for your answer, finally I solved my problem on Windows so ill keep working on Windows. I added the solution on my answer just in case someone find the same problem.


Log in to reply