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

Linking to multiple dll and lib files in qt



  • Hi
    I would like to know what is the proper way to link to multiple dll and lib files and how would I test if they are properly linked or not.

    This is how I did it:

    myproject . pro:

    LIBS += -L$$PWD/dependencies -lole32 -ldxva2 -lwbemuuid
    
    INCLUDEPATH += $$PWD/dependencies
    DEPENDPATH += $$PWD/dependencies
    

    I have created a folder namely dependencies inside my project directory and placed all the dll and lib files in it.

    dependencies folder:

    0_1559471091217_Capture.PNG


  • Lifetime Qt Champion

    Hi
    Looks ok but you are telling it to look for include files in
    INCLUDEPATH += $$PWD/dependencies
    which seems not to be the case.

    Also, for system DLLs, like ole32, one normally does not copy it around but simply refers to it
    LIBS += -lole32
    and the compiler/toolchain should know how to get system DLLS.

    To check what if it works, look in the compiler output pane.
    You can see what it links to.
    However, it will also give you linker errors if not found. ( and you used any of its functions)


Log in to reply