Building Qt5 for cross-compilling to Raspberry Pi error



  • Hello,

    I am on Ubuntu 16.04 and I use QtCreator to develop an application that I need to run on a raspberry pi 3.
    I choose to use cross-compilling and followed this tutorial from Qt Wiki : http://wiki.qt.io/Raspberry_Pi_Beginners_Guide

    I followed everything and it went fine, except for the "Compiling qtbase" step. If you look at the tutorial, you'll see that there is the configure command, that's where I am, let me explain. The configure command is working perfectly I think, because I have this output :

    <srcbase> = /home/nathan/opt/qt5/qtbase 
    <bldbase> = /home/nathan/opt/qt5/qtbase 
    <outbase> = /home/nathan/opt/qt5/qtbase 
    Creating qmake...
    .Done.
    
    This is the Qt Open Source Edition.
    
    You have already accepted the terms of the Open Source license.
    
    Running configuration tests...
    Done running configuration tests.
    
    

    Next step is of course the "make" command. But that's where the problem is, when I type "make -j 4" it says that there is no target specified and that no makefile exists. And when I look into the qt5/qtbase folder, there is indeed no makefile whatsoever.
    And that seems weird since I followed the tutorial from the begginning without issues, and now I got this, and google didn't help me....

    Thanks if you have the solution, I'll keep searching on my own meanwhile.


  • Moderators

    Configure prints a summary after it finishes. If it didn't in your case, something went wrong.

    I recommend following this guide https://wiki.qt.io/RaspberryPi2EGLFS it definitely works.


  • Moderators

    You can also run configure in verbose mode to see exactly what goes wrong.



  • @sierdzio Thanks, I will try that tutorial !
    I made the configure with verbose option, and after creating qmake, it adds that "make : nothing to do for 'first'", so it seems that something is going wrong but I can't see what.


  • Moderators

    @Vertebro said in Building Qt5 for cross-compilling to Raspberry Pi error:

    @sierdzio Thanks, I will try that tutorial !
    I made the configure with verbose option, and after creating qmake, it adds that "make : nothing to do for 'first'", so it seems that something is going wrong but I can't see what.

    Until you post more info here (like the output you're getting), we can't see what's wrong, too.



  • @sierdzio Okay sorry, here is the output :

    nathan@BTSSNIR-8:~/opt/qt5/qtbase$ sudo ./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 -hostprefix /usr/local/qt5pi -v
    <srcbase> = /home/nathan/opt/qt5/qtbase 
    <bldbase> = /home/nathan/opt/qt5/qtbase 
    <outbase> = /home/nathan/opt/qt5/qtbase 
    Creating qmake...
    make: rien à faire pour « first ».
    Command line: -opengl es2 -device linux-rasp-pi-g++ -device-option CROSS_COMPILE=/home/nathan/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 -hostprefix /usr/local/qt5pi -v
    
    This is the Qt Open Source Edition.
    
    You have already accepted the terms of the Open Source license.
    
    Running configuration tests...
    Done running configuration tests.
    
    Configure summary:
    
    Building on: linux-g++ (x86_64, CPU features: mmx sse sse2)
    Building for: devices/linux-rasp-pi-g++ (arm, CPU features: <none>)
    Configuration: cross_compile compile_examples enable_new_dtags largefile precompile_header shared rpath release c++11 concurrent dbus reduce_exports release_tools stl
    Build options:
      Mode ................................... release; optimized tools
      Optimize release build for size ........ no
      Building shared libraries .............. yes
      Using C++ standard ..................... C++11
      Using ccache ........................... no
      Using gold linker ...................... no
      Using new DTAGS ........................ yes
      Using precompiled headers .............. yes
      Using LTCG ............................. no
      Target compiler supports:
        NEON ................................. no
      Build parts ............................ libs
    Qt modules and options:
      Qt Concurrent .......................... yes
      Qt D-Bus ............................... yes
      Qt D-Bus directly linked to libdbus .... no
      Qt Gui ................................. yes
      Qt Network ............................. yes
      Qt Sql ................................. yes
      Qt Testlib ............................. yes
      Qt Widgets ............................. yes
      Qt Xml ................................. yes
    Support enabled for:
      Using pkg-config ....................... yes
      udev ................................... no
      Using system zlib ...................... yes
    Qt Core:
      DoubleConversion ....................... yes
        Using system DoubleConversion ........ no
      GLib ................................... no
      iconv .................................. yes
      ICU .................................... no
      Tracing backend ........................ <none>
      Logging backends:
        journald ............................. no
        syslog ............................... no
        slog2 ................................ no
      Using system PCRE2 ..................... no
    Qt Network:
      getifaddrs() ........................... yes
      IPv6 ifname ............................ yes
      libproxy ............................... no
      Linux AF_NETLINK ....................... yes
      OpenSSL ................................ no
        Qt directly linked to OpenSSL ........ no
      OpenSSL 1.1 ............................ no
      SCTP ................................... no
      Use system proxies ..................... yes
    Qt Gui:
      Accessibility .......................... yes
      FreeType ............................... yes
        Using system FreeType ................ yes
      HarfBuzz ............................... yes
        Using system HarfBuzz ................ no
      Fontconfig ............................. no
      Image formats:
        GIF .................................. yes
        ICO .................................. yes
        JPEG ................................. yes
          Using system libjpeg ............... no
        PNG .................................. yes
          Using system libpng ................ yes
      EGL .................................... no
      OpenVG ................................. no
      OpenGL:
        Desktop OpenGL ....................... no
        OpenGL ES 2.0 ........................ no
        OpenGL ES 3.0 ........................ no
        OpenGL ES 3.1 ........................ no
        OpenGL ES 3.2 ........................ no
      Vulkan ................................. no
      Session Management ..................... yes
    Features used by QPA backends:
      evdev .................................. yes
      libinput ............................... no
      INTEGRITY HID .......................... no
      mtdev .................................. no
      tslib .................................. no
      xkbcommon-evdev ........................ no
    QPA backends:
      DirectFB ............................... no
      EGLFS .................................. no
      LinuxFB ................................ yes
      VNC .................................... yes
      Mir client ............................. no
    Qt Widgets:
      GTK+ ................................... no
      Styles ................................. Fusion Windows
    Qt PrintSupport:
      CUPS ................................... no
    Qt Sql:
      DB2 (IBM) .............................. no
      InterBase .............................. no
      MySql .................................. no
      OCI (Oracle) ........................... no
      ODBC ................................... no
      PostgreSQL ............................. no
      SQLite2 ................................ no
      SQLite ................................. yes
        Using system provided SQLite ......... no
      TDS (Sybase) ........................... no
    
    Note: Also available for Linux: linux-clang linux-icc
    
    Note: -optimized-tools is not useful in -release mode.
    
    ERROR: Feature 'opengles2' was enabled, but the pre-condition 'config.win32 || (!config.watchos && !features.opengl-desktop && libs.opengl_es2)' failed.
    
    ERROR: The OpenGL functionality tests 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 the mkspec for your platform.
    

    Here you go, but I extracted the most important info in my last post I think, but if you want the output here it is


  • Moderators

    Ok, I see 3 issues here:

    • you run configure via sudo... that's not good. Not necessarily an error, but there is certainly no need for root permissions when compiling Qt
    • you're running configure from qtbase dir instead of the main configure from Qt (from root Qt dir). But maybe that's specific to the way this tutorial works
    • your OpenGL tests are failing! This means that configure has not actually finished, so no wonder that Makefile is missing or empty! You need to fix the OpenGL issue first and then try to run clean and configure again


  • I finally managed to complete the process by using your tutorial.
    I added to qt creator and done everything, it compiles fine, but it won't run :

    pi@raspi_15:~ $ ./RPItest
    -bash: ./RPItest: cannot execute binary file: Exec format error
    

    What append ?



  • Okay everything done ! I messed up a bit. Cross compilation is working;

    Now my only problem is to get libmysqlcppconn to work on raspberry pi 3.


  • Moderators

    Nice, congrats!

    Unfortunately I've never used Qt & MySQL together on a RPi so I (probably) can't help with that.



  • Thanks ! DOn't worry now that cross compilation works everything will go smooth, I'll probably use python for sql if I don't succeed with c++ and sql


  • Lifetime Qt Champion

    Hi,

    You'll likely have to use the MariaDB package to be able to build the plugin for RPi.

    Hope it helps


  • Banned

    This post is deleted!

Log in to reply
 

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