Import multiple libraries in Qt Creator 4.0.2



  • Hi,

    Does anyone knows if it is an already known bug or is just a decision to make importing multiple libs a pain in Qt Creator 4?

    The problem is: I want to include all libraries in a given directory, because, like the example below, the framework opencv has many libraries and I don't like of looking for each one that I'm gonna use and then put its entire path.

    In 3.4, this was working (on Windows):
    LIBS += -L "C:/opencv/compilado_novo/bin/*.dll"

    I could just write all my stuff, without having to worry about what library I need for each function.

    But now, in Qt Creator 4, only this works:
    LIBS += C:/opencv/compilado_novo/bin/libopencv_core310.dll
    LIBS += C:/opencv/compilado_novo/bin/libopencv_highgui310.dll
    LIBS += C:/opencv/compilado_novo/bin/libopencv_imgproc310.dll
    LIBS += C:/opencv/compilado_novo/bin/libopencv_imgcodecs310.dll

    Thanks!



  • You normally do not link to the .dll but to the .lib file

    to simplify you can use

    LIBS += -LC:/opencv/compilado_novo/bin  \
    -llibopencv_core310  \
    -llibopencv_highgui310  \
    -llibopencv_imgproc310  \
    -llibopencv_imgcodecs310  \
    

    you should really control manually what you link against but if you insist in using wildcards see http://stackoverflow.com/questions/24635696/adding-all-external-libraries-stored-from-a-directory-into-qt-project



  • @VRonin Thanks!


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.