About raspberry pi cross compile ?



  • Hi,
    I'm new on qt world. And I'm going lose it. I study on this link to perform cross compile on ubuntu for raspberry pi.I lost my three days because of it. I get the following error at ./configure step.

    opengles2.cpp:37:25: fatal error: GLES2/gl2.h: No such file or directory
    compilation terminated.
    make: *** [opengles2.o] Error 1
    OpenGL disabled.
    The OpenGL ES 2.0 functionality test failed!
    You might need to modify the include and library search paths by editing
    QMAKE_INCDIR_OPENGL_ES2, QMAKE_LIBDIR_OPENGL_ES2 and QMAKE_LIBS_OPENGL_ES2 in
    /home/sefa/opt/qt5/qtbase/mkspecs/devices/linux-rasp-pi-g++.

    The contents of qmake.config file as ;

    include(../common/linux_device_pre.conf)

    QMAKE_LFLAGS += -Wl,-rpath-link,$$[QT_SYSROOT]/opt/vc/lib

    QMAKE_LIBDIR_OPENGL_ES2 = /home/sefa/opt/qt5/qtbase/mkspecs
    QMAKE_LIBDIR_EGL = $$QMAKE_LIBDIR_OPENGL_ES2

    QMAKE_INCDIR_EGL = $$[QT_SYSROOT]/opt/vc/include
    $$[QT_SYSROOT]/opt/vc/include/interface/vcos/pthreads
    $$[QT_SYSROOT]/opt/vc/include/interface/vmcs_host/linux
    QMAKE_INCDIR_OPENGL_ES2 = $${QMAKE_INCDIR_EGL}

    QMAKE_LIBS_EGL = -lEGL -lGLESv2

    contains(DISTRO, squeeze) {
    #Debian Squeeze: Legacy everything
    QMAKE_LIBS_OPENGL_ES2 = -lGLESv2 -lEGL
    } else:contains(DISTRO, arch) {
    #On principle: no wizardry required
    } else {
    #This is not strictly necessary
    DISTRO_OPTS += deb-multi-arch
    DISTRO_OPTS += hard-float
    }

    QMAKE_CFLAGS +=
    -marm
    -mfpu=vfp
    -mtune=arm1176jzf-s
    -march=armv6zk
    -mabi=aapcs-linux

    QMAKE_CXXFLAGS = $$QMAKE_CFLAGS

    EGLFS_PLATFORM_HOOKS_SOURCES = $$PWD/qeglfshooks_pi.cpp
    EGLFS_PLATFORM_HOOKS_LIBS = -lbcm_host

    include(../common/linux_arm_device_post.conf)

    load(qt_config)

    how can I fix it. Please help me. Thanks for answer.


  • Lifetime Qt Champion

    Hi,

    Do you have GLES2/gl2.h somewhere in the Raspberry Pi sysroot ?



  • There are three units file as gl2.h on my pc. The locations of these files in that ;
    /home/sefa/opt/qt5/qtbase/mkspecs/common/ios/GLES2
    /home/sefa/opt/qt5/qtbase/src/3rdparty/angle/include/GLES2
    /home/sefa/opt/qt5/qtwebkit/Source/ThirdParty/ANGLE/include/GLES2


  • Lifetime Qt Champion

    You need to mount your Raspberry Pi root file system in order to access the needed files



  • I mount raspberry pi root file system. This time, it's a different error as;

    /home/sefa/opt/gcc-4.7-linaro-rpi-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/4.7.2/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lGLESv2
    collect2: error: ld returned 1 exit status
    make: *** [opengles2] Error 1
    OpenGL disabled.
    The OpenGL ES 2.0 functionality test failed!
    You might need to modify the include and library search paths by editing
    QMAKE_INCDIR_OPENGL_ES2, QMAKE_LIBDIR_OPENGL_ES2 and QMAKE_LIBS_OPENGL_ES2 in
    /home/sefa/opt/qt5/qtbase/mkspecs/devices/linux-rasp-pi-g++.


  • Lifetime Qt Champion

    Did you restart configuration from a clean state ?



  • Thank you for your interest.yes I restart from a clean state.


  • Lifetime Qt Champion

    You modified the raspberry mkspec, you should revert them.



  • How can I revert them ?


  • Lifetime Qt Champion

    If you cloned the sources just git checkout. Otherwise extract the file from the archive and replace it



  • I checkout git and same problem continous.


  • Lifetime Qt Champion

    The question is the same as before did you correctly cleanup before restarting configure ?



  • @SGaist Thank you. I did all the steps from the beginning and the problem was solved. Problem, turn off the computer after completing mount step. I need to do again mount after computer shuts down. I learned it because of you.I have some questions but it can be little silly questions but I really did not understand. why we use the sd card? After the umount step, SD card boot partition has occurred. Then what do we do with this SD card?
    Another one, after umount step , does not look anything in the /mnt/rasp-pi-rootfs. is this a normal situation?


  • Lifetime Qt Champion

    That SD card contains the root file system where all the needed libraries/header can be find to build Qt and the applications. You could also copy the content of that file system on your computer but you would then need to copy again the Qt libraries on the SD Card once you built/installed them.

    When you mount a drive on a folder, you'll be able to access the content of that drive. Once you unmount it, you'll see again what was in that folder. In your case it's empty. So nothing to worry about !



  • Thanks for information. Now I'm trying compile and run a hello world project. But I could not. In the qt version tab, there is an exclamation mark before the kit I added. İt say at bottom of the page Qt version is not properly installed. I use qt 5.4 version. In that page it looks here Qt 5.5.0 (qt5pi). When I compiled project, fails in the following way

    Cannot read /mnt/rasp-pi-rootfs2/usr/local/qt5pi/mkspecs/devices/linux-rasp-pi-g++/qmake.conf: No such file or directory
    Could not read qmake configuration file /mnt/rasp-pi-rootfs2/usr/local/qt5pi/mkspecs/devices/linux-rasp-pi-g++/qmake.conf.
    Could not find qmake configuration file default.
    Error while parsing file /home/sefa/Masaüstü/Qt projects/AAARASPBERRY/qt5-raspberrypi-example-qt5-raspberrypi-example/helloworld.pro. Giving up.
    Cannot read /home/sefa/rsp/gcc-4.7-linaro-rpi-gnueabihf/bin/arm-linux-gnueabihf-gdb/qmake.conf: No such file or directory
    Could not read qmake configuration file /home/sefa/rsp/gcc-4.7-linaro-rpi-gnueabihf/bin/arm-linux-gnueabihf-gdb/qmake.conf.
    Error while parsing file /home/sefa/Masaüstü/Qt projects/AAARASPBERRY/qt5-raspberrypi-example-qt5-raspberrypi-example/helloworld.pro. Giving up.

    How can I fix it.



  • We need to show qmake which in the qt5pi folder. But mnt/rasp-pi-rootfs is empty on my pc. So I showed qmake from sdcart. This may be caused by ?


  • Lifetime Qt Champion

    Just mount the Pi root file system before starting to work on your project


Log in to reply
 

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