Cross compiling for Raspberry Error



  • hello guys,
    This is my first post in that amazing forum :p

    I wanted to cross compile QT 4.8 in my RPi3B from my Linux 16.04LTS so I've followed the Tutorial https://wiki.qt.io/Raspberry_Pi_Beginners_Guide to make it, But i got some errors while i was doing the make -j 4

    here is the error:

    In file included from ../../include/QtXml/qxml.h:1:0,
                     from dom/qdom.cpp:54:
    ../../include/QtXml/../../src/xml/sax/qxml.h:121:5: error: function ‘QXmlAttributes::QXmlAttributes(QXmlAttributes&&)’ defaulted on its first declaration with an exception-specification that differs from the implicit declaration ‘QXmlAttributes::QXmlAttributes(QXmlAttributes&&)’
    Makefile:1493 : la recette pour la cible « .obj/qdom.o » a échouée
    make[2]: *** [.obj/qdom.o] Erreur 1
    make[2] : on quitte le répertoire « /home/dayaa/opt/qt5/qtbase/src/xml »
    Makefile:307 : la recette pour la cible « sub-xml-install_subtargets » a échouée
    make[1]: *** [sub-xml-install_subtargets] Erreur 2
    make[1] : on quitte le répertoire « /home/dayaa/opt/qt5/qtbase/src »
    Makefile:58 : la recette pour la cible « sub-src-install_subtargets » a échouée
    make: *** [sub-src-install_subtargets] Erreur 2
    
    

    Any help would be Appriciated!!

    thank you guys


  • Moderators

    @Pilot.Rockstar

    HI and welcome to devnet forum

    This line looks very strange respectively suspoious to me

    ../../include/QtXml/../../src/xml/sax/qxml.h:121:5: error: function ‘QXmlAttributes::QXmlAttributes(QXmlAttributes&&)’ defaulted on its first declaration with an exception-specification that differs from the implicit declaration ‘QXmlAttributes::QXmlAttributes(QXmlAttributes&&)’
    

    Verify if you can find this as it is shown in the file.

    Where did you get the source of Qt 4.8 from?

    The official source for Qt version 4.8.6 is here ready for download.

    You may use a changed version of Qt source. I have no raspberry experience, but I know sometimes you have to make slight changes.



  • thank you buddy for the Answer, The problem was in the Source that i've downloaded from their .git so i've downloaded Qt 5.7 but now still have a problem with Qt3D that didn't crosscompile!

    Thanx for help :)



  • @koahnig

    This issue also occurs in the latest QT5 --> git://code.qt.io/qt/qt5.git

    /home/nbkhwjm/opt/gcc-4.7-linaro-rpi-gnueabihf/bin/arm-linux-gnueabihf-g++ -c -include .pch/Qt5Xml -pipe -marm -mfpu=vfp -mtune=arm1176jzf-s -march=armv6zk -mabi=aapcs-linux -mfloat-abi=hard --sysroot=/mnt/rasp-pi-rootfs -O2 -std=c++11 -fvisibility=hidden -fvisibility-inlines-hidden -fno-exceptions -Wall -W -Wvla -D_REENTRANT -fPIC -DQT_NO_USING_NAMESPACE -DQT_NO_FOREACH -DQT_BUILD_XML_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_CORE_LIB -I. -I../../include -I../../include/QtXml -I../../include/QtXml/5.8.1 -I../../include/QtXml/5.8.1/QtXml -I../../include/QtCore/5.8.1 -I../../include/QtCore/5.8.1/QtCore -I../../include/QtCore -I.moc -I../../mkspecs/devices/linux-rasp-pi-g++ -o .obj/qdom.o dom/qdom.cpp
    In file included from ../../include/QtXml/qxml.h:1:0,
    from dom/qdom.cpp:54:
    ../../include/QtXml/../../src/xml/sax/qxml.h:121:5: error: function ‘QXmlAttributes::QXmlAttributes(QXmlAttributes&&)’ defaulted on its first declaration with an exception-specification that differs from the implicit declaration ‘QXmlAttributes::QXmlAttributes(QXmlAttributes&&)’
    Makefile:1350: recipe for target '.obj/qdom.o' failed
    make[2]: *** [.obj/qdom.o] Error 1
    make[2]: Leaving directory '/home/nbkhwjm/opt/qt5/qtbase/src/xml'
    Makefile:295: recipe for target 'sub-xml-make_first' failed
    make[1]: *** [sub-xml-make_first] Error 2
    make[1]: Leaving directory '/home/nbkhwjm/opt/qt5/qtbase/src'
    Makefile:46: recipe for target 'sub-src-make_first' failed
    make: *** [sub-src-make_first] Error 2

    any ideas to this error?


  • Moderators

    @nbkhwjm

    The only recommendation from my side is using Qt 5.7.
    According to @Pilot-Rockstar at least up to Qt3D component.

    Also you should check the compiler you are using. Personally I have made the experince that due to compilers for cross-compilation lagging back in versions issues with newest Qt releases may have problems.



  • @koahnig

    I was able to get farther along in the build..

    Errors in build with -Wdate-time is not supported
    first, there are a ton of errors from the -Wdate-time parameter thrown by the compiler. Since we are using the linaro 4.7 cross compiler, they are not supported.. I opened the ./qtbase/mkspecs/features/qt_common.prf and commented out all the lines that added -Wdate-time to the makefiles.. This prevents the copiler errors

    error: function ‘QXmlAttributes::QXmlAttributes(QXmlAttributes&&)’ defaulted on its first declaration with an exception-specification that differs from the implicit declaration ‘QXmlAttributes::QXmlAttributes(QXmlAttributes&&)’

    I opened the /qt5/qtbase/src/xml/sax/qxml.h file and removed and changed:
    QXmlAttributes(QXmlAttributes &&) Q_DECL_NOTHROW = default

    to

    QXmlAttributes(QXmlAttributes &&) = default

    then it compiled

    Im sure there are better ways to do this taking into account macros for the compiler im using, but this got me through it..



  • @nbkhwjm Thank you for the trick for QXmlAttributes....
    It was very helpful.
    As I corrected that error, another error related to "eglfs". I managed to solve that by using the "-no-eglfs" flag while configuring qtbase (as I am not using eglfs in the qt application to be developped). I hope that will not break any thing !


Log in to reply
 

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