Cross Compilation errors



  • I hope this topic hasn't been covered elsewhere, I have been doing some digging but haven't found anything which seems useful.

    I have been trying to set up my Pi to allow me to run cross compiled applications from my desktop. I have been following the guide "here":http://qt-project.org/wiki/RaspberryPi_Beginners_guide but have been struggling on a couple of points.

    1. It seems that the link for the compiler used in the guide is no longer functioning. I used the alternate compiler from "here":https://github.com/raspberrypi/tools and change all of the paths: "~/opt/gcc-4.7-linaro-rpi-gnueabihf/bin/arm-linux-gnueabihf-gcc" to "~/opt/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc" for the fixQualifiedLibraryPaths step and "~/opt/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-" for the configure step. Does that look right?

    2. As I have found in other posts, it doesn't seem that the qtjsbackend patch is needed anymore correct?

    When I run the ./configure command I get the following error (provided in context):

    @rm -f libqsqlite.so
    /home/nathan/opt/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++ -Wl,-rpath-link,/mnt/rasp-pi-rootfs/opt/vc/lib -Wl,-rpath-link,/mnt/rasp-pi-rootfs/usr/lib/arm-linux-gnueabihf -Wl,-rpath-link,/mnt/rasp-pi-rootfs/lib/arm-linux-gnueabihf --sysroot=/mnt/rasp-pi-rootfs -Wl,--no-undefined -Wl,-O1 -Wl,-rpath,/usr/local/qt5pi/lib -shared -o libqsqlite.so .obj/release-shared/smain.o .obj/release-shared/qsql_sqlite.o .obj/release-shared/sqlite3.o .obj/release-shared/moc_qsql_sqlite_p.o -L/home/nathan/opt/qt5/qtbase/lib -lQt5Sql -lQt5Core -lpthread
    mv -f libqsqlite.so ../../../../plugins/sqldrivers/
    make[4]: Leaving directory /home/nathan/opt/qt5/qtbase/src/plugins/sqldrivers/sqlite' make[3]: Leaving directory/home/nathan/opt/qt5/qtbase/src/plugins/sqldrivers'
    make[2]: Leaving directory /home/nathan/opt/qt5/qtbase/src/plugins' make[1]: *** [sub-plugins-make_first] Error 2 make[1]: Leaving directory/home/nathan/opt/qt5/qtbase/src'
    make: *** [sub-src-make_first] Error 2@

    I tried adding a -no-pch to the end of the ./configure command but didn't get any farther. I can run the make -j 4 and sudo make install commands but when it comes time to run /usr/local/qt5pi/bin/qmake it isn't there. I am not terribly experienced in Linux so I have hit a brick wall with these errors.

    Any help to resolve this is appreciated!

    Nate


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    The output you posted doesn't show the error you are getting. Can you re-run the compilation with only make ? The error will be easier to spot



  • Thanks for the welcome!

    After running a, "make clean," I used the command, "make" and saw the following response:

    @/home/nathan/opt/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++ -c -pipe -marm -mfpu=vfp -mtune=arm1176jzf-s -march=armv6zk -mabi=aapcs-linux -mfloat-abi=hard --sysroot=/mnt/rasp-pi-rootfs -O2 -fvisibility=hidden -fvisibility-inlines-hidden -std=c++0x -fno-exceptions -Wall -W -D_REENTRANT -fPIC -DQT_NO_XCB -DQT_NO_XKBCOMMON -DMESA_EGL_NO_X11_HEADERS -DEGLFS_PLATFORM_HOOKS -DQ_FONTCONFIGDATABASE -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_PLUGIN -DQT_PLATFORMSUPPORT_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../../../../mkspecs/devices/linux-rasp-pi-g++ -I. -I. -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../../../../include -I../../../../include/QtPlatformSupport -I../../../../include/QtPlatformSupport/5.2.0 -I../../../../include/QtPlatformSupport/5.2.0/QtPlatformSupport -I../../../../include/QtGui -I../../../../include/QtGui/5.2.0 -I../../../../include/QtGui/5.2.0/QtGui -I../../../../include/QtCore -I../../../../include/QtCore/5.2.0 -I../../../../include/QtCore/5.2.0/QtCore -I.moc/release-shared -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 -o .obj/release-shared/qeglfshooks_pi.o ../../../../mkspecs/devices/linux-rasp-pi-g++/qeglfshooks_pi.cpp
    ../../../../mkspecs/devices/linux-rasp-pi-g++/qeglfshooks_pi.cpp: In function ‘void moveDispmanxLayer(EGLNativeWindowType, const QPoint&)’:
    ../../../../mkspecs/devices/linux-rasp-pi-g++/qeglfshooks_pi.cpp:125:66: error: cannot convert ‘DISPMANX_TRANSFORM_T’ to ‘VC_IMAGE_TRANSFORM_T’ for argument ‘9’ to ‘int vc_dispmanx_element_change_attributes(DISPMANX_UPDATE_HANDLE_T, DISPMANX_ELEMENT_HANDLE_T, uint32_t, int32_t, uint8_t, const VC_RECT_T*, const VC_RECT_T*, DISPMANX_RESOURCE_HANDLE_T, VC_IMAGE_TRANSFORM_T)’
    ../../../../mkspecs/devices/linux-rasp-pi-g++/qeglfshooks_pi.cpp: At global scope:
    ../../../../mkspecs/devices/linux-rasp-pi-g++/qeglfshooks_pi.cpp:189:10: warning: unused parameter ‘window’ [-Wunused-parameter]
    make[4]: *** [.obj/release-shared/qeglfshooks_pi.o] Error 1
    make[4]: Leaving directory /home/nathan/opt/qt5/qtbase/src/plugins/platforms/eglfs' make[3]: *** [sub-eglfs-make_first] Error 2 make[3]: Leaving directory/home/nathan/opt/qt5/qtbase/src/plugins/platforms'
    make[2]: *** [sub-platforms-make_first] Error 2
    make[2]: Leaving directory /home/nathan/opt/qt5/qtbase/src/plugins' make[1]: *** [sub-plugins-make_first] Error 2 make[1]: Leaving directory/home/nathan/opt/qt5/qtbase/src'
    make: *** [sub-src-make_first] Error 2
    @

    So it looks like the error is called out in line 3? There is so much output from the build I don't really know what to add here. Does that help?

    Thanks again!



  • Any help on fixing this? If any more info is needed I can provide it.

    Thanks!



  • I have been working on compiling it again and using the following configure command:

    @ ./configure -opengl es2 -device linux-rasp-pi-g++ -device-option CROSS_COMPILE=~/opt/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf- -sysroot /mnt/rasp-pi-rootfs -opensource -confirm-license -optimized-qmake -reduce-relocations -reduce-exports -release -make libs -prefix /usr/local/qt5pi
    @

    When I run make I seethe following error:

    @compiler/qv4isel_masm_p.h: In member function ‘void QQmlJS::MASM::Assembler::storeUInt32(JSC::AbstractMacroAssemblerJSC::ARMAssembler::RegisterID, QQmlJS::MASM::Assembler::Pointer)’:
    compiler/qv4isel_masm_p.h:1210:63: error: ‘convertUInt32ToDouble’ was not declared in this scope
    compiler/qv4isel_masm_p.h: In member function ‘void QQmlJS::MASM::InstructionSelection::convertUIntToDouble(QQmlJS::V4IR::Temp*, QQmlJS::V4IR::Temp*)’:
    compiler/qv4isel_masm_p.h:1489:18: error: ‘class QQmlJS::MASM::Assembler’ has no member named ‘convertUInt32ToDouble’
    compiler/qv4isel_masm_p.h:1491:18: error: ‘class QQmlJS::MASM::Assembler’ has no member named ‘convertUInt32ToDouble’
    compiler/qv4isel_masm.cpp: In member function ‘virtual void QQmlJS::MASM::InstructionSelection::visitRet(QQmlJS::V4IR::Ret*)’:
    compiler/qv4isel_masm.cpp:1905:22: error: ‘class QQmlJS::MASM::Assembler’ has no member named ‘convertUInt32ToDouble’
    compiler/qv4isel_masm.cpp: In member function ‘JSC::AbstractMacroAssemblerJSC::ARMAssembler::Jump QQmlJS::MASM::InstructionSelection::genTryDoubleConversion(QQmlJS::V4IR::Expr*, JSC::MacroAssemblerARM::FPRegisterID)’:
    compiler/qv4isel_masm.cpp:2099:14: error: ‘class QQmlJS::MASM::Assembler’ has no member named ‘convertUInt32ToDouble’
    make[3]: *** [.obj/release-shared/qv4isel_masm.o] Error 1
    make[3]: *** Waiting for unfinished jobs....
    make[3]: Leaving directory /home/nathan/opt/qt5/qtdeclarative/src/qml' make[2]: *** [sub-qml-make_first-ordered] Error 2 make[2]: Leaving directory/home/nathan/opt/qt5/qtdeclarative/src'
    make[1]: *** [sub-src-make_first] Error 2
    make[1]: Leaving directory `/home/nathan/opt/qt5/qtdeclarative'
    make: *** [module-qtdeclarative-make_first] Error 2
    @

    Any thoughts?



  • Looks like it was a bug. A patch for this bug is currently available here and I hope will be pushed out soon. I was able to get qtdeclarative to compile after performing the changes.

    https://bugreports.qt-project.org/browse/QTBUG-34065



  • Hello, For the past few days I was trying to cross-compile QT for Raspberry PI on Lion Osx using helpful script called "trismer-bakeqtpi-osx" all dependencies are automatically being downloaded together with latest QT5.2.1 tree ... then the configuration options are as follows:

    sudo ./configure -opengl es2 -qt-libpng -device linux-rasp-pi-g++ -device-option CROSS_COMPILE=~/opt/arm-linux-gnueabihf-osx/bin/arm-linux-gnueabihf- -sysroot ~/opt/rasp-pi-rootfs -opensource -confirm-license -optimized-qmake -release -make libs -prefix /usr/local/qt5pi -hostprefix ~/opt/qt5pi -no-pch

    but make -j 4 results with an errors:

    ../../../../mkspecs/devices/linux-rasp-pi-g++/qeglfshooks_pi.cpp: In function ‘void moveDispmanxLayer(EGLNativeWindowType, const QPoint&)’:
    ../../../../mkspecs/devices/linux-rasp-pi-g++/qeglfshooks_pi.cpp:125:66: error: cannot convert ‘DISPMANX_TRANSFORM_T’ to ‘VC_IMAGE_TRANSFORM_T’ for argument ‘9’ to ‘int vc_dispmanx_element_change_attributes(DISPMANX_UPDATE_HANDLE_T, DISPMANX_ELEMENT_HANDLE_T, uint32_t, int32_t, uint8_t, const VC_RECT_T*, const VC_RECT_T*, DISPMANX_RESOURCE_HANDLE_T, VC_IMAGE_TRANSFORM_T)’
    ../../../../mkspecs/devices/linux-rasp-pi-g++/qeglfshooks_pi.cpp: At global scope:
    ../../../../mkspecs/devices/linux-rasp-pi-g++/qeglfshooks_pi.cpp:189:10: warning: unused parameter ‘window’ [-Wunused-parameter]
    make[4]: *** [.obj/qeglfshooks_pi.o] Error 1
    make[3]: *** [sub-eglfs-make_first] Error 2
    make[2]: *** [sub-platforms-make_first] Error 2
    make[1]: *** [sub-plugins-make_first] Error 2
    make: *** [sub-src-make_first] Error 2



  • I have tried some time,it seems to zhe same problem with you

    ../../../../mkspecs/devices/linux-rasp-pi-g++/qeglfshooks_pi.cpp: In function ‘void moveDispmanxLayer(EGLNativeWindowType, const QPoint&)’:
    ../../../../mkspecs/devices/linux-rasp-pi-g++/qeglfshooks_pi.cpp:125:66: error: cannot convert ‘DISPMANX_TRANSFORM_T’ to ‘VC_IMAGE_TRANSFORM_T’ for argument ‘9’ to ‘int vc_dispmanx_element_change_attributes(DISPMANX_UPDATE_HANDLE_T, DISPMANX_ELEMENT_HANDLE_T, uint32_t, int32_t, uint8_t, const VC_RECT_T*, const VC_RECT_T*, DISPMANX_RESOURCE_HANDLE_T, VC_IMAGE_TRANSFORM_T)’
    ../../../../mkspecs/devices/linux-rasp-pi-g++/qeglfshooks_pi.cpp: At global scope:
    ../../../../mkspecs/devices/linux-rasp-pi-g++/qeglfshooks_pi.cpp:99:13: warning: ‘void moveDispmanxLayer(EGLNativeWindowType, const QPoint&)’ defined but not used [-Wunused-function]
    make[4]: *** [.obj/qeglfshooks_pi.o] 错误 1
    make[4]: Leaving directory /home/zhuzhu/opt/qt5/qtbase/src/plugins/platforms/eglfs' make[3]: *** [sub-eglfs-make_first] 错误 2 make[3]: Leaving directory/home/zhuzhu/opt/qt5/qtbase/src/plugins/platforms'
    make[2]: *** [sub-platforms-make_first] 错误 2
    make[2]: Leaving directory /home/zhuzhu/opt/qt5/qtbase/src/plugins' make[1]: *** [sub-plugins-make_first] 错误 2 make[1]: Leaving directory/home/zhuzhu/opt/qt5/qtbase/src'
    make: *** [sub-src-make_first] 错误 2



  • Ok Solution:
    type in root$ sudo find ~/opt -type f -exec grep -H 'vc_dispmanx_element_change_attributes' {} ;
    Password: your_root_password
    then it should find 2 locations
    /Users/your_user_name/opt/qt5/qtbase/mkspecs/devices/linux-rasp-pi-g++/qeglfshooks_pi.cpp
    and
    /Users/your_user_name/opt/rasp-pi-rootfs/opt/vc/include/interface/vmcs_host/vc_dispmanx.h
    First edit prototype of function in vc_dispmanx.h from:

    VCHPRE_ int VCHPOST_ vc_dispmanx_element_change_attributes( DISPMANX_UPDATE_HANDLE_T update,
    DISPMANX_ELEMENT_HANDLE_T element,
    uint32_t change_flags,
    int32_t layer,
    uint8_t opacity,
    const VC_RECT_T *dest_rect,
    const VC_RECT_T *src_rect,
    DISPMANX_RESOURCE_HANDLE_T mask,
    VC_IMAGE_TRANSFORM_T transform );

    To:

    VCHPRE_ int VCHPOST_ vc_dispmanx_element_change_attributes( DISPMANX_UPDATE_HANDLE_T update,
    DISPMANX_ELEMENT_HANDLE_T element,
    uint32_t change_flags,
    int32_t layer,
    uint8_t opacity,
    const VC_RECT_T *dest_rect,
    const VC_RECT_T *src_rect,
    DISPMANX_RESOURCE_HANDLE_T mask,
    DISPMANX_TRANSFORM_T transform );

    Then Edit

    /Users/your_user_name/opt/qt5/qtbase/mkspecs/devices/linux-rasp-pi-g++/qeglfshooks_pi.cpp

    go to function moveDispmanxLayer and make sure it looks like this:

    static void moveDispmanxLayer(EGLNativeWindowType window, const QPoint &pos)
    {
    EGL_DISPMANX_WINDOW_T *eglWindow = static_cast<EGL_DISPMANX_WINDOW_T *>(window);
    QSize size(eglWindow->width, eglWindow->height);

    VC_RECT_T dst_rect;
    dst_rect.x = pos.x();
    dst_rect.y = pos.y();
    dst_rect.width = size.width();
    dst_rect.height = size.height();
    
    VC_RECT_T src_rect;
    src_rect.x = 0;
    src_rect.y = 0;
    src_rect.width = size.width() << 16;
    src_rect.height = size.height() << 16;
    
    DISPMANX_UPDATE_HANDLE_T dispman_update = vc_dispmanx_update_start(0);
    vc_dispmanx_element_change_attributes(dispman_update,
                                          eglWindow->element,
                                          ELEMENT_CHANGE_DEST_RECT /*change_flags*/,
                                          0,
                                          0,
                                          &dst_rect,
                                          NULL,
                                          0,
                                          (DISPMANX_TRANSFORM_T)0);
    
    vc_dispmanx_update_submit_sync(dispman_update);
    

    }

    Then recompile

    Setup your QT creator to be pointing back into new cross compiler and debuggers as per QT tutorial

    After all this I was able to successfully compile Hello World project ...

    Now I am struggling to deploy this project to run on the Raspberry PI because it says :

    bash: /home/pi/helloworld/helloworld: No such file or directory
    Application finished with exit code 127.

    Is Qt Creator equipped in more verbose console to see what is the problem and why the application is not deployed after successful compilation ?



  • If you don't need support for XCB (ie you will be using QtQuick on the Pi and not Widgets) trying configuring Qt with -no-xcb. If you don't plan on using QtQuick or OpenGL, configure Qt with -no-opengl XCB and OpenGL not compatable on the Raspberry Pi as of now. Here is a link to the official bug report/fix:
    https://bugreports.qt-project.org/browse/QTBUG-36551



  • Thanks Charles for your reply but i have posted solution in my last post above ... the only other problem after successful cross compilation is deployment of the app. Please look towards the end of my post ...



  • this is default hello world example *.pro file:

    TEMPLATE = app

    target.path = /home/pi/helloworld
    TARGET = helloworld
    INSTALLS += target

    DEPENDPATH += .
    INCLUDEPATH += .

    QT += quick

    SOURCES += main.cpp
    INCLUDEPATH += /mnt/rasp-pi-rootfs/usr/local/qt5pi/include/
    qml_folder.source = qml
    DEPLOYMENTFOLDERS = qml_folder

    OTHER_FILES +=
    qml/*

    for(deploymentfolder, DEPLOYMENTFOLDERS) {
    item = item$${deploymentfolder}
    itemsources = $${item}.sources
    $$itemsources = $$eval($${deploymentfolder}.source)
    itempath = $${item}.path
    $$itempath= $$eval($${deploymentfolder}.target)
    export($$itemsources)
    export($$itempath)
    DEPLOYMENT += $$item
    }

    installPrefix = /home/pi/$${TARGET}

    for(deploymentfolder, DEPLOYMENTFOLDERS) {
    item = item$${deploymentfolder}
    itemfiles = $${item}.files
    $$itemfiles = $$eval($${deploymentfolder}.source)
    itempath = $${item}.path
    $$itempath = $${installPrefix}/$$eval($${deploymentfolder}.target)
    export($$itemfiles)
    export($$itempath)
    INSTALLS += $$item
    }

    when I press run it has the following settings:
    Kit: Raspberry Pi
    Deploy to remote linux host
    Run hello world on remote device

    When Raspberry is not present on the network (192.168.1.144) Qt says: "Application failed to start: Timeout waiting for reply from server.

    But when its present on the network:
    "bash: /home/pi/helloworld/helloworld: No such file or directory
    Application finished with exit code 127."

    After compilation of cross-compiler takes place do I need to then deploy cross compiler to Raspberry or write any changes to it? I do run Raspbian on it that came together with NOOBS flashcard ... I thought the whole point of compiling on the PC side it that PC can produce an app and then this app can be pushed over to Raspberry and work on it in its native environment without any hassle. But it seams I am still missing something.



  • well I can ssh to my Pi on the following address 192.168.1.144 and when I setup remote host (Pi) in the Qt settings there's a test button that you can press to check comms and this is all ok ... maybe it is something to do with folder permissions ... I just don't know yet as Qt is not very verbose ... it just says there's no such a folder or directory ... I don't believe that it is transferring anything across



  • Hi psyhotron,

    I walk the same waylike you, changed the DISPMANX and then the ./ configure works; i can make and make install.

    After I setup QT creator and oben the example helloworld I can not correct build it because of message "missing module(s) in QT: quick

    What's happend? Any ideas?

    Micha.


Log in to reply
 

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