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

Compile error fatal



  • Hi,
    I downloaded QtOpcUa from this Git repository https://github.com/qt/qtopcua/tree/5.14.0
    and try buld it but i get this error

    mingw32-make install

    C:\Users\usr\Documents\LIB\qtopcua-5.14.0\src\opcua\core\qopcuaplugin.h:40:10: fatal error: QtOpcUa/qopcuaglobal.h: No such file or directory
     #include <QtOpcUa/qopcuaglobal.h>
              ^~~~~~~~~~~~~~~~~~~~~~~~
    compilation terminated.
    mingw32-make[2]: *** [Makefile:2034: .obj/qopcuaprovider.o] Error 1
    mingw32-make[2]: Leaving directory 'C:/Users/usr/Documents/LIB/qtopcua-5.14.0/build/src/opcua'
    mingw32-make[1]: *** [Makefile:64: sub-opcua-install_subtargets] Error 2
    mingw32-make[1]: Leaving directory 'C:/Users/usr/Documents/LIB/qtopcua-5.14.0/build/src'
    mingw32-make: *** [Makefile:65: sub-src-install_subtargets] Error 2
    

    i used qmake.exe 5.14.0\mingw73_64
    and mingw32-make.exe wich is in tools folder

    can someone help me please, i have no idea what to do here


  • Qt Champions 2019

    @LeLev Does this header file exist?



  • @jsulm hi
    yes
    qopcuaglobal.h is under
    C:\Users\usr\Documents\LIB\qtopcua-5.14.0\src\opcua

    and the file where it is included (qopcuaplugin.h) is here
    C:\Users\usr\Documents\LIB\qtopcua-5.14.0\src\opcua\core
    it is included like this
    #include <QtOpcUa/qopcuaglobal.h>

    and the pro file says (C:\Users\usr\Documents\LIB\qtopcua-5.14.0\src\opcua\opcua.pro)
    PUBLIC_HEADERS += qopcuaglobal.h



  • @jsulm should i change the include statement to
    #include "../qopcuaglobal.h" ?

    edit : same error here solved by switching compiler, but in my case i have to use mingw
    https://forum.qt.io/topic/105182/qtopcua-5-12-4-on-windows-10-compile-error


  • Qt Champions 2019

    @LeLev said in Compile error fatal:

    should i change the include statement to

    You should not.
    You could contact the author of that repo.



  • @jsulm thx
    i tryed to contact the author but could not find how..

    Then i tryed this qt io repo https://code.qt.io/qt/qtopcua.git

    i do
    git clone https://code.qt.io/qt/qtopcua.git
    git checkout remotes/origin/5.14
    qmake
    mingw32-make

    and now another file is not found ..

    In file included from C:\Users\usr\Documents\LIB\qtopcua\src\opcua\x509\qopcuax509certificatesigningrequest.cpp:38:0:
    C:\Users\usr\Documents\LIB\qtopcua\src\opcua\x509\openssl_symbols_p.h:59:10: fatal error: openssl/asn1.h: No such file or directory
     #include <openssl/asn1.h>
              ^~~~~~~~~~~~~~~~
    compilation terminated.
    mingw32-make[2]: *** [Makefile:6798: .obj/qopcuax509certificatesigningrequest.o] Error 1
    mingw32-make[2]: Leaving directory 'C:/Users/usr/Documents/LIB/qtopcua/build/src/opcua'
    mingw32-make[1]: *** [Makefile:52: sub-opcua-make_first] Error 2
    mingw32-make[1]: Leaving directory 'C:/Users/usr/Documents/LIB/qtopcua/build/src'
    mingw32-make: *** [Makefile:53: sub-src-make_first] Error 2
    

  • Qt Champions 2019

    @LeLev said in Compile error fatal:

    openssl/asn1.h

    You do not have OpenSSL lib/header



  • @jsulm i have installed my qt version 5.14.0 this morning, and i have checked OpenSSL 1.1.1d Toolkit in the Tools section
    so i have openssl files in my qt tools directory C:\Qt\Tools\OpenSSL\Win_x64\ lib and include

    where i have to put them ? or do i have to set path to it before i call mingw32-make ?


  • Qt Champions 2019

    @LeLev said in Compile error fatal:

    or do i have to set path to it before i call mingw32-make ?

    I guess so, yes (actually before qmake call)



  • @jsulm i have added this 3 env variables
    C:\Qt\Tools\OpenSSL\Win_x64\bin
    C:\Qt\Tools\OpenSSL\Win_x64\include\openssl
    C:\Qt\Tools\OpenSSL\Win_x64\lib

    but asn1.h is still not found during the comilation (it is here > C:\Qt\Tools\OpenSSL\Win_x64\include\openssl)

    C:\Users\usr\Documents\LIB\qtopcua\src\opcua\x509\openssl_symbols_p.h:59:10: fatal error: openssl/asn1.h: No such file or directory
     #include <openssl/asn1.h>
              ^~~~~~~~~~~~~~~~
    

  • Qt Champions 2019

    @LeLev said in Compile error fatal:

    C:\Qt\Tools\OpenSSL\Win_x64\bin
    C:\Qt\Tools\OpenSSL\Win_x64\include\openssl
    C:\Qt\Tools\OpenSSL\Win_x64\lib

    These are paths not env variables, so what exactly did you do?



  • @jsulm sorry,
    i added these paths to my PATH in the windows environnement variables editor


  • Qt Champions 2019

    @LeLev Adding directory with header files to PATH will not help. Try

    qmake "INCLUDEPATH+=C:\Qt\Tools\OpenSSL\Win_x64\include\openssl"
    


  • @jsulm Thank you very much ! finally compiled

    qmake "INCLUDEPATH+=C:\Qt\Tools\OpenSSL\Win_x64\include" ..
    mingw32-make
    but when i try mingw32-make install
    i get this ..

    C:\Users\usr\Documents\LIB\qtopcua\build>mingw32-make install
    cd src\ && ( if not exist Makefile C:\Qt\5.14.0\mingw73_64\bin\qmake.exe -o Makefile C:\Users\usr\Documents\LIB\qtopcua\src\src.pro "INCLUDEPATH+=C:\Qt\Tools\OpenSSL\Win_x64\include" ) && mingw32-make -f Makefile install
    mingw32-make[1]: Entering directory 'C:/Users/usr/Documents/LIB/qtopcua/build/src'
    cd opcua\ && ( if not exist Makefile C:\Qt\5.14.0\mingw73_64\bin\qmake.exe -o Makefile C:\Users\usr\Documents\LIB\qtopcua\src\opcua\opcua.pro "INCLUDEPATH+=C:\Qt\Tools\OpenSSL\Win_x64\include" ) && mingw32-make -f Makefile install
    mingw32-make[2]: Entering directory 'C:/Users/usr/Documents/LIB/qtopcua/build/src/opcua'
    copy /y ..\..\lib\Qt5OpcUa.dll C:\Qt\5.14.0\mingw73_64\bin\Qt5OpcUa.dll
            1 file(s) copied
    C:\Qt\5.14.0\mingw73_64\bin\qmake.exe -install sed  -e "s,C:/Users/usr/Documents/LIB/qtopcua/build/lib,$$[QT_INSTALL_LIBS],g" -e "s,C:\\\\Users\\\\usr\\\\Documents\\\\LIB\\\\qtopcua\\\\build\\\\lib,$$[QT_INSTALL_LIBS],gi" -e "s,C:/Qt/5.14.0/mingw73_64/lib,$$[QT_INSTALL_LIBS],g" -e "s,C:\\\\Qt\\\\5.14.0\\\\mingw73_64\\\\lib,$$[QT_INSTALL_LIBS],gi" ..\..\lib\Qt5OpcUa.prl > C:\Qt\5.14.0\mingw73_64\lib\Qt5OpcUa.prl
    C:\Qt\5.14.0\mingw73_64\bin\qmake.exe -install sed  -e "s,C:/Users/usr/Documents/LIB/qtopcua/build/lib,C:/Qt/5.14.0/mingw73_64/lib,g" -e "s,C:\\\\Users\\\\usr\\\\Documents\\\\LIB\\\\qtopcua\\\\build\\\\lib,C:\\\\Qt\\\\5.14.0\\\\mingw73_64\\\\lib,gi" ..\..\build\lib\pkgconfig\Qt5OpcUa.pc > C:\Qt\5.14.0\mingw73_64\lib\pkgconfig\Qt5OpcUa.pc
    ..\..\build\lib\pkgconfig\Qt5OpcUa.pc: No such file or directory
    mingw32-make[2]: *** [Makefile:7994: install_target] Error 1
    mingw32-make[2]: Leaving directory 'C:/Users/usr/Documents/LIB/qtopcua/build/src/opcua'
    mingw32-make[1]: *** [Makefile:64: sub-opcua-install_subtargets] Error 2
    mingw32-make[1]: Leaving directory 'C:/Users/usr/Documents/LIB/qtopcua/build/src'
    mingw32-make: *** [Makefile:65: sub-src-install_subtargets] Error 2
    

    I will try to copy all the files manually and see what happens



  • copying files manually did not work...

    if i understand correctly the probleme is Qt5OpcUa.pc file is not found
    ..\build\lib\pkgconfig\Qt5OpcUa.pc: No such file or directory
    but it is created here after i compiled the project
    C:\Users\usr\Documents\LIB\qtopcua\build\lib\pkgconfig\Qt5OpcUa.pc

    so is there maybe a way to pass it to mingw32-make install just like i passed open ssl path to qmake ?

    edit :
    Qt5OpcUa.pc file is created in my C:\Qt\5.14.0\mingw73_64\lib\pkgconfig folder after i call mingw32-make install but it is empty

    in my build directory (C:\Users\usr\Documents\LIB\qtopcua\build\lib\pkgconfig)
    Qt5OpcUa.pc s content is

    prefix=C:/Qt/5.14.0/mingw73_64
    exec_prefix=${prefix}
    libdir=${prefix}/lib
    includedir=${prefix}/include
    
    
    Name: Qt5 OpcUa
    Description: Qt OpcUa module
    Version: 5.14.0
    Libs: -L${libdir} -lQt5OpcUa 
    Cflags: -DQT_OPCUA_LIB -I${includedir}/QtOpcUa -I${includedir}
    Requires: Qt5Core Qt5Network
    
    


  • @LeLev said in Compile error fatal:

    copying files manually did not work...

    i managed to copy files manually !
    C:\Users\usr\Documents\LIB\qtopcua\build\bin\Qt5OpcUa.dll
    C:\Users\usr\Documents\LIB\qtopcua\build\include
    C:\Users\usrDocuments\LIB\qtopcua\build\lib
    C:\Users\usr\Documents\LIB\qtopcua\build\mkspecs
    C:\Users\usr\Documents\LIB\qtopcua\build\plugins
    C:\Users\usr\Documents\LIB\qtopcua\build\qml

    @jsulm thank you very much for your support



  • I also encountered this problem, I will try this solution to verify whether it works.....
    I have spent a lot of time solving this problem.



  • Google translated: @LeLev Thank you for sharing, following your steps, “mingw32-make install ”is also this kind of error.
    I found that after executing the install command, a file was successfully assigned Qt5OpcUa.dll, and this file is located in the directory "..\.. \ lib \ Qt5OpcUa.dll", which is the path, the installer considers it valid, and reports an error The path is "..\.. \ build \ lib \ pkgconfig \ Qt5OpcUa.pc", which means that this directory is invalid. Therefore, I re-created a "build" directory in the same directory as the "lib" directory, and copied the "lib" directory and its files. and then re-execute "mingw32-make install", finally installed!



  • Google translated: @Rick-feng
    In addition, in the second qmake above, the files in the build directory need to be emptied.
    And qmake "INCLUDEPATH + = C: \ Qt \ Tools \ OpenSSL \ Win_x64 \ include" .. There must be no spaces in the specified directory!


  • Lifetime Qt Champion

    @Rick-feng please use english, this is the official language of this forum. There is a dedicated sub-forum for Chinese.

    Google translated: 请使用英语,这是该论坛的官方语言。 有一个专门的中文分论坛。



  • @SGaist Sorry, I do n’t know the rules, I have replaced it with Google Translate


Log in to reply