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

Building a 3rd party lib



  • Hi,
    I'm trying to build this library to use it with my Qt 5.15 - mingw kit

    The lib is called QAds, it is a qt wrapper for Beckhoff ADS library that allows communication with Beckhoff PLCs.

    when i try to built it, i get

    ....\QAds/include/tc3manager.h:18:10: fatal error: TcAdsDef.h: No such file or directory

    source file (tc3manager.h )

    #ifdef __linux__
    #include "AdsDef.h"
    #define __stdcall
    #elif _WIN32
    #include <TcAdsDef.h>
    #include <TcAdsAPI.h>
    #else
    #endif
    

    so i went in the librarys .pro file :

    INCLUDEPATH += $$PWD/lib/ADS/AdsLib
    
        SOURCES += \
            lib/ADS/AdsLib/AdsDef.cpp \
    ...
    

    there is in fact a folder called lib in the project folder but it is empty, so i simply cloned the original Beckhoff ADS there,
    now INCLUDEPATH and SOURCES look good but if i try to build again, i still have the same error
    Does someone know how to solve this please ?

    Thank you


  • Lifetime Qt Champion

    @LeLev said in Building a 3rd party lib:

    i still have the same error

    Did you rerun qmake?
    From the readme: "This repository is using https://github.com/Beckhoff/ADS as submodule". So, should be enough to do "git submodule init" and "git submodule update".



  • hi, thank you for answering
    @jsulm said in Building a 3rd party lib:

    Did you rerun qmake?

    yes i did rerun qmake.

    @jsulm said in Building a 3rd party lib:

    So, should be enough to do "git submodule init" and "git submodule update".

    I didn't knew these commands honestly.
    I tryed, it cloned the Beckhoff ADS project in the lib folder
    but unfortunattely i still have the same error when i try to run mingw32-make

    If i open the project with QtCreator and go to the file where the error is, i see qt creator warnings on the include lines :
    //tc3manager.h

    #elif _WIN32
    #include <TcAdsDef.h>  // file not found 
    #include <TcAdsAPI.h> // file not found
    

    but if i go to the .pro everything looks ok

    SOURCES += \
           lib/ADS/AdsLib/AdsDef.cpp \
    

  • Lifetime Qt Champion

    Hi,

    Did you saw that the main QAdd .pro file has a unix scope ?



  • Hi
    @SGaist said in Building a 3rd party lib:

    Did you saw that the main QAdd .pro file has a unix scope ?

    No, but i'm not sure what does that mean, Could you please clarify ?
    Does that mean it is meant to be built on Linux ?


  • Lifetime Qt Champion

    It means that what's between the curly brackets apply only to Unix like OS like Linux and macOS.

    Since you are building on Windows, that part is going to be ignored.

    If you want to try to build that stuff on Windows, remove the scope. You will likely have to do coding depending on what errors you'll get while building the project (with some luck it might just succeed).



  • @SGaist said in Building a 3rd party lib:

    It means that what's between the curly brackets apply only to Unix like OS like Linux and macOS.
    Since you are building on Windows, that part is going to be ignored.

    Yes i got it,
    my bad for not noticing that

    Thank you.


Log in to reply