QQmlApplicationEngine no such file or directory



  • Hi,

    TARGET:

    I am developing a QT app for rpi 0 w. I have used buildroot to create my own image. This is the buildroot config for qt5 package.

    BR2_PACKAGE_QT5=y
    BR2_PACKAGE_QT5_VERSION_5_6=y
    BR2_PACKAGE_QT5BASE_EXAMPLES=y
    BR2_PACKAGE_QT5BASE_OPENGL_LIB=y
    BR2_PACKAGE_QT5BASE_LINUXFB=y
    BR2_PACKAGE_QT5BASE_EGLFS=y
    BR2_PACKAGE_QT5BASE_DEFAULT_QPA="linuxfb"
    BR2_PACKAGE_QT5BASE_FONTCONFIG=y
    BR2_PACKAGE_QT5QUICKCONTROLS=y
    BR2_PACKAGE_QT5QUICKCONTROLS2=y

    I am able to run qt sample applications with no problem.

    HOST:

    I am developing the app on Windows PC with Qt Creator 4.10.2 (Based on Qt 5.13.2 (MSVC 2017, 32 bit))

    I can build and run the app on the Windows PC

    PROBLEM:

    • I am using the Buildroot's qmake to build the qt app for target deploying.
    • I add the buildroot's bin directory to environment variables (export PATH=$(pwd)/output/host/bin:$PATH)
    • Go into the project's directory
      $ qmake
      $ make

    Here I get the next error:

    "
    /home/ibercomp/rcr/projects/cp4/buildroot/output/host/bin/arm-linux-gnueabihf-g++ -c -pipe -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os --sysroot=/home/ibercomp/rcr/projects/cp4/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot -O2 -std=gnu++0x -Wall -W -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -I. -I. -I../../buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/include/qt5 -I../../buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/include/qt5/QtGui -I../../buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/include/qt5/QtCore -I. -I../../buildroot/output/host/mkspecs/devices/linux-buildroot-g++ -o main.o main.cpp

    main.cpp:2:33: fatal error: QQmlApplicationEngine: No such file or directory
    "

    Any idea of what I am missing?

    Kind regards,

    Rafa


  • Qt Champions 2019

    @rscr This header file is part of QML module. See https://doc.qt.io/qt-5/qqmlapplicationengine.html



  • @jsulm are you meaning that with my configuration I have not included the QML module?

    Sorry for my ignorance but I am new on qt

    Kind regards,

    Rafa


  • Qt Champions 2019

    @rscr said in QQmlApplicationEngine no such file or directory:

    I have not included the QML module?

    Looks like QML is not part of your Qt installation..
    You can also search for QQmlApplicationEngine header file in your Qt installation.



  • Hello,

    Solved, I think the problem was with the .pro file. I do not how but it was not corresponding with the one generated with QtCreator. Maybe it was autogenerated when trying the qmake command, it is possible?

    Kind regards,

    Rafa


  • Lifetime Qt Champion

    Hi,

    qmake -project generates a .pro file but it does not do deep inspection so you have to check its content and add the parts that it does not know about. For example the modules that you are going to use beside the defaults.


Log in to reply