Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Unknown module(s) in QT: quickcontrols2



  • Hello,
    I am trying to build my app on my Pi. To that purpose I installed Qt in that way:

    sudo apt-get install qt5-default
    sudo apt-get install qtcreator
    sudo apt-get install qtdeclarative5-dev
    

    I have two problems. The first one, Qt Creator isn't working for this reason:

    qtcreator: error while loading shared libraries: libGLESv2.so: cannot open shared object file: No such file or directory
    

    So I tried to compile my application with terminal, but I got that error:

    pi@raspberrypi:~/Documents/urecran/appliUR $ qmake appliUR.pro 
    Project ERROR: Unknown module(s) in QT: quickcontrols2
    

    Why QuickControls are not found.
    How can I made the compilation working?

    Thanks in adavnce!


  • Lifetime Qt Champion

    Hi,

    What does qmake --version tell you ?

    What distribution are you using on your Pi ?



  • @SGaist Hi,
    The result of qmake version :

    QMake version 3.0
    Using Qt version 5.7.1 in /usr/lib/arm-linux-gnueabihf
    

    Here, my distribution:

    PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
    NAME="Raspbian GNU/Linux"
    VERSION_ID="9"
    VERSION="9 (stretch)"
    ID=raspbian
    ID_LIKE=debian
    HOME_URL="http://www.raspbian.org/"
    SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
    BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
    

  • Lifetime Qt Champion

    Do you have the libgles2-mesa-dev package installed ?

    You also need to install qtquickcontrols2-5-dev



  • @SGaist
    It's compiling!
    I just got a makefile error :

    /usr/bin/ld: cannot find -lGLESv2
    collect2: error: ld returned 1 exit status
    Makefile:143: recipe for target 'appliUR' failed
    

  • Lifetime Qt Champion

    Did you install libgles2-mesa-dev ?



  • @SGaist
    Yes, I got the following result:

    pi@raspberrypi:~/Documents/urecran/appliUR $ sudo apt-get install libgles2-mesa-dev
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    libgles2-mesa-dev is already the newest version (13.0.6-1+rpi2).
    The following packages were automatically installed and are no longer required:
      lxkeymap python-cairo python-gobject python-gobject-2 python-gtk2 python-xklavier
    Use 'sudo apt autoremove' to remove them.
    0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
    
    

    (sorry I have to wait 600 seconds to post a new message)


  • Lifetime Qt Champion

    What distribution are you using ?



  • @SGaist As I said, I use Raspbian :

    PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
    NAME="Raspbian GNU/Linux"
    VERSION_ID="9"
    VERSION="9 (stretch)"
    ID=raspbian
    ID_LIKE=debian
    HOME_URL="http://www.raspbian.org/"
    SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
    BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
    

    At less you want more informations?


  • Lifetime Qt Champion

    Did you check whether you have this library somewhere on your OS ?



  • @SGaist I tried this function:

    ldconfig -p | grep libgles2-mesa-dev
    

    I have no output, so I suppose the lib is not installed? So why apt-get told me it is already installed?


  • Lifetime Qt Champion

    You are mixing the name of the package and the name of the library. Use grep -i gles.



  • @SGaist said in Unknown module(s) in QT: quickcontrols2:

    grep -i gles

    I got this result:

    pi@raspberrypi:/ $ ldconfig -p | grep -i gles
    	libbrcmGLESv2.so (libc6,hard-float) => /opt/vc/lib/libbrcmGLESv2.so
    	libGLESv1_CM.so.1 (libc6,hard-float) => /usr/lib/arm-linux-gnueabihf/libGLESv1_CM.so.1
    

    Both folder don't exist.


  • Lifetime Qt Champion

    IIRC, the quick workaround would to create a symbolic link named libGLESv2.so to your libbrcmGLESv2.so



  • @SGaist
    I never did that before.
    So I tried that :

    sudo ln -s /opt/vc/lib/libbrcmGLESv2.so /opt/vc/lib/libGLESv2.so
    

    But now the compilation failed:

    pi@raspberrypi:~/Documents/urecran/appliUR $ make
    g++ -Wl,-O1 -Wl,-rpath-link,/usr/lib/arm-linux-gnueabihf -o appliUR main.o strategiesmodel.o communication.o qrc_qml.o moc_strategiesmodel.o moc_communication.o   -lQt5QuickControls2 -lQt5Quick -lQt5Gui -lQt5Qml -lQt5Network -lQt5Core -lGLESv2 -lpthread 
    /usr/bin/ld: cannot find -lGLESv2
    collect2: error: ld returned 1 exit status
    Makefile:143: recipe for target 'appliUR' failed
    make: *** [appliUR] Error 1
    

    It was the right command?


  • Lifetime Qt Champion

    Because the linker won't search for libraries in /opt/vc/lib/. Add it to your .pro file with a line like LIBS += -L/opt/vc/lib/



  • @SGaist
    Visibly another component need the lib and doesn't find the symbolic link. Sorry to be so nooby.

    pi@raspberrypi:~/Documents/urecran/appliUR $ make
    g++ -Wl,-O1 -Wl,-rpath-link,/usr/lib/arm-linux-gnueabihf -o appliUR main.o strategiesmodel.o communication.o qrc_qml.o moc_strategiesmodel.o moc_communication.o   -L/opt/vc/lib/ -lQt5QuickControls2 -lQt5Quick -lQt5Gui -lQt5Qml -lQt5Network -lQt5Core -lGLESv2 -lpthread 
    /usr/bin/ld: warning: libGLESv2.so.2, needed by /usr/lib/gcc/arm-linux-gnueabihf/6/../../../arm-linux-gnueabihf/libQt5Quick.so, not found (try using -rpath or -rpath-link)
    


  • I am stupid, it's just a warning. The application compiled.
    I just have a problem when I want to execute the program. The symbolic link doesn't work:

    ./appliUR: error while loading shared libraries: libGLESv2.so: cannot open shared object file: No such file or directory
    

  • Moderators

    You need to enable the vc4 gpu driver in raspi-config. I think it is listed under experimental section.



  • @sierdzio
    I was in :

    7 Advanced options > A7 GL Driver > G1 GL (Full KMS)
    

    (I din't find reference to VC4 GPU Driver in my raspi-config)

    I don't now if it's that? But it didn't work, even after reboot.


  • Lifetime Qt Champion

    Modify LD_LIBRARY_PATH so that it also point to that folder.


  • Moderators

    @DarkPatate said in Unknown module(s) in QT: quickcontrols2:

    I don't now if it's that? But it didn't work, even after reboot.

    Looks like it. Shame it didn't work. Try the other options maybe, but they are less likely to work.



  • @SGaist now all the librairy are found. But there is a missing plugin:

    pi@raspberrypi:~/Documents/appliUR $ ./appliUR 
    This application failed to start because it could not find or load the Qt platform plugin "eglfs"
    in "".
    
    Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, xcb.
    
    Reinstalling the application may fix this problem.
    Aborted
    

    So I tried to create a sym link to the EGL lib too:

    sudo ln -s /opt/vc/lib/libbrcmEGL.so /opt/vc/lib/libEGL.so
    

    But it didn't work. It's almost working!

    @sierdzio I tried all options, without success.


  • Moderators

    Eglfs platform plugin is a Qt plugin, located in <qt dir>/plugins/platforms.

    Most probably your Qt was compiled for XCB (X11) only. Try running your app with -platform xcb argument (but expect low performance from this plugin...).



  • @sierdzio said in Unknown module(s) in QT: quickcontrols2:

    -platform xcb

    I got the same pb with xcb. I tried also linuxfb and minimal, without success :/


  • Moderators

    I see. Well, that answer won't make you happy, perhaps, but: try following the "RPI eglfs" (Google it) guide and cross compile Qt yourself.

    If definitely works, I've used Qt, with Qt Quick, many times. There are issues with the drivers, sure. But in general it works.



  • @sierdzio sorry for the very late reply, I was so busy. I tried this solution long time ago but I failed. I will try again and let you know :)


  • Moderators

    Here's the link by the way https://wiki.qt.io/RaspberryPi2EGLFS

    I recommend getting the source tarball instead of using git: https://download.qt.io/archive/qt/5.10/5.10.1/single/ Less to download, no need to run init-repository - in general less hassle (unless you want to contribute to Qt, but that's not the case here).


Log in to reply