QT 5.4 cross compilation



  • Hello,

    I have been trying to cross compile qt 5.4 from the git repo following this link http://qt-project.org/wiki/RaspberryPi_Beginners_guide

    That went fairly well for qtbase assuming you have to patch the following files (which i found somewhere else on this forums) with the following :

    @sudo nano /mnt/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 :

    @sudo nano ~/opt/qt5/qtbase/mkspecs/devices/linux-rasp-pi-g++/qeglfshooks_pi.cpp@

    Then 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_r$
    vc_dispmanx_update_submit_sync(dispman_update);
    }@

    With that i have been able to cross compile qtbase on 5.4 branch.

    Then i wanted to build qtwebkit on the same principle.

    I am using :

    @cd ~/opt/qt5/qtwebkit
    ./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
    make -j 8@

    But the make operation will fail.

    Before going further into explanations, i would like to know if Qt 5.4 is supposed to build on RPi and if all submodules are supposed to build especially qtwebkit ?

    Thanks.



  • I got it to cross build properly using a qt 5.4 beta sources snapshot that i grabbed from the qt downloads. This doesnt seem to require any patch.

    Although, if i create a small new widget projectand build, i builds find, if i deploy that on rpi and run it, the app will start but looks like fullscreen where it should be in a window.

    I'm running it from raspbian desktop, but it seems that something is wrong with the windowing.

    Would anyone have a clue on what i got wrong ? how come this window doesnt appear like a window but comes fullscreen ?

    I have read some things about linuxfb, xcb, wayland that are different supported windowing systems, would that be related ?

    Thanks for any hint you could give :)


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    If your using the linuxfb plugin, then you don't have any windowing system so your application takes the whole screen and it's normal. You didn't do anything wrong

    xcb is the plugin to talk with your Xorg server and wayland is another beast also providing a windowing system that can replace Xorg.

    Hope it helps



  • Thanks for your reply Sgaist ;)

    So if i want to have my program work like it does on other platform (ie open a window inside X11) i should use xcb from what you said.

    How do i select this is that by with the -platform flags that you can provide from commandline ?

    Sorry for the noobish question, it was kind of strange to me to get this behvior quite different from the other platforms im used to.

    Thanks :)


  • Lifetime Qt Champion

    You're welcome !

    That's right, -platform xcb

    Embedded platforms are a different universe ;)



  • Hello,

    I am not able to compile Qt 5.4.1 Webkit module in Linux for Raspberry PI. Everything build proper except webkit. Whenever, I tried to compile, It was broken and shows me following error.

    Project ERROR: WebKit requires SQLite. Either make it available via pkg-config, set $SQLITE3SRCDIR or build WebKit under qt5.git.

    After setting $SQLITE3SRCDIR environment variable , It started to build and braked again with following error.
    **
    fatal error: sqlite3.h No such file or directory. compilation terminated.
    **
    I have changed cmake files and pri files of webkit but still getting same error. If any body have any idea regarding it, Then please help me. I will appreciate your help.

    Thanks

    Tushar Kachhadiya


Log in to reply
 

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