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

QtKNX - Compilation errors out of the box



  • I am currently trying to integrate QtKNX into our project. For this, I grabbed the corresponding repository from github. Fired up the good old QtCreator and hoped for the best.

    After clonging the repository, I opened the *.pro project file in Qt creator, selected the Qt 5.13.1 + MinGW 7.3.0 64-bit kit and ran QMake.
    Runnin QMake was successful.
    When trying to compile, I ran into errors immediately:

    11:49:02: Running steps for project qtknx...
    11:49:02: Configuration unchanged, skipping qmake step.
    11:49:02: Starting: "C:\Qt\Tools\mingw730_64\bin\mingw32-make.exe" -j12
    cd src\ && ( if not exist Makefile C:\Qt\5.13.1\mingw73_64\bin\qmake.exe -o Makefile C:\Users\joel\Downloads\qtknx-dev\src\src.pro -spec win32-g++ "CONFIG+=debug" "CONFIG+=qml_debug" ) && C:/Qt/Tools/mingw730_64/bin/mingw32-make -f Makefile 
    mingw32-make[1]: Entering directory 'C:/Users/joel/Downloads/build-qtknx-Desktop_Qt_5_13_1_MinGW_64_bit-Debug/src'
    
    [...]
    
    mingw32-make[3]: *** [Makefile.Release:2787: .obj/release/qknx4byteunsignedvalue.o] Error 1
    In file included from C:\Users\joel\Downloads\qtknx-dev\src\knx\core\qknxbytearray.cpp:41:0:
    C:\Users\joel\Downloads\qtknx-dev\src\knx\core\qknxbytearray.h:47:10: fatal error: QtKnx/qtknxglobal.h: No such file or directory
     #include <QtKnx/qtknxglobal.h>
              ^~~~~~~~~~~~~~~~~~~~~
    compilation terminated.
    In file included from C:\Users\joel\Downloads\qtknx-dev\src\knx\core\qknxbytearray.cpp:41:0:
    C:\Users\joel\Downloads\qtknx-dev\src\knx\core\qknxbytearray.h:47:10: fatal error: QtKnx/qtknxglobal.h: No such file or directory
     #include <QtKnx/qtknxglobal.h>
              ^~~~~~~~~~~~~~~~~~~~~
    compilation terminated.
    mingw32-make[3]: *** [Makefile.Release:1926: .obj/release/qknxbytearray.o] Error 1
    mingw32-make[3]: *** [Makefile.Debug:1926: .obj/debug/qknxbytearray.o] Error 1
    mingw32-make[2]: *** [Makefile:42: debug-all] Error 2
    mingw32-make[2]: *** Waiting for unfinished jobs....
    mingw32-make[2]: *** [Makefile:56: release-all] Error 2
    mingw32-make[1]: *** [Makefile:43: sub-knx-make_first] Error 2
    mingw32-make: *** [Makefile:45: sub-src-make_first] Error 2
    mingw32-make[3]: Leaving directory 'C:/Users/joel/Downloads/build-qtknx-Desktop_Qt_5_13_1_MinGW_64_bit-Debug/src/knx'
    mingw32-make[3]: Leaving directory 'C:/Users/joel/Downloads/build-qtknx-Desktop_Qt_5_13_1_MinGW_64_bit-Debug/src/knx'
    mingw32-make[2]: Leaving directory 'C:/Users/joel/Downloads/build-qtknx-Desktop_Qt_5_13_1_MinGW_64_bit-Debug/src/knx'
    mingw32-make[1]: Leaving directory 'C:/Users/joel/Downloads/build-qtknx-Desktop_Qt_5_13_1_MinGW_64_bit-Debug/src'
    11:49:04: The process "C:\Qt\Tools\mingw730_64\bin\mingw32-make.exe" exited with code 2.
    Error while building/deploying project qtknx (kit: Desktop Qt 5.13.1 MinGW 64-bit)
    When executing step "Make"
    11:49:04: Elapsed time: 00:02.
    

    The full build output can be found as a paste here.

    So it seems that various header inclusions such as <QtKnx/qtnxdatapointtype.h>, <QtKnx/qtknxglobal.h> an do so on are not being found. However, these are also the files that I am trying to compile right now into a usable QtKNX binary.

    Personally I had the expectation that I can just fire up QtCreator, hit the green button of glory and call it a day. But it seems like I am missing some path setups. But then again: These are the files I am trying to compile.

    What exactly am I missing here? Do I need to manually change some build variables such as Q_KNX_EXPORT?
    I never tried to compile a Qt module before (except for the webengine all those years ago... lets not speak of that outside of my therapist's office).

    I'd be thankful for any kind of hint.

    I am using:

    • Windows 10, 64-bit
    • Qt Creator 4.10.0
    • Qt 5.13.1
    • MinGW 7.3.0 64-bit
    • Whatever qmake version came with the standard install

    Any kind of help on this would be appreciated.


  • Lifetime Qt Champion

    Hi @Joel-Bodenmann,

    which branch did you check out in QtKnx git repo?

    Regards



  • @aha_1980 said in QtKNX - Compilation errors out of the box:

    which branch did you check out in QtKnx git repo?

    The master branch.


  • Lifetime Qt Champion

    @Joel-Bodenmann try the one matching your Qt version.

    Regards


  • Lifetime Qt Champion

    Hi,

    AFAIK, there's no master branch, did you mean dev ?

    In any case, usually that error comes from forward header files not generated. Do you have Perl installed on your system ?



  • @SGaist said in QtKNX - Compilation errors out of the box:

    AFAIK, there's no master branch, did you mean dev ?

    Yep!

    @aha_1980 said in QtKNX - Compilation errors out of the box:

    @Joel-Bodenmann try the one matching your Qt version.

    Well that was a good recommendation :p

    After checking out the branch that matched my Qt version and ensuring that QtCreator/QMake can find my perl binary, I was able to build without any issues!


Log in to reply