Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Import multiple libraries in Qt Creator 4.0.2
QtWS25 Last Chance

Import multiple libraries in Qt Creator 4.0.2

Scheduled Pinned Locked Moved Solved General and Desktop
importlibraryqt creator4.0.2
3 Posts 2 Posters 3.1k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    tradeli
    wrote on 18 Aug 2016, 15:57 last edited by
    #1

    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!

    1 Reply Last reply
    0
    • V Offline
      V Offline
      VRonin
      wrote on 18 Aug 2016, 16:37 last edited by
      #2

      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

      "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
      ~Napoleon Bonaparte

      On a crusade to banish setIndexWidget() from the holy land of Qt

      T 1 Reply Last reply 18 Aug 2016, 19:38
      5
      • V VRonin
        18 Aug 2016, 16:37

        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

        T Offline
        T Offline
        tradeli
        wrote on 18 Aug 2016, 19:38 last edited by
        #3

        @VRonin Thanks!

        1 Reply Last reply
        0

        3/3

        18 Aug 2016, 19:38

        • Login

        • Login or register to search.
        3 out of 3
        • First post
          3/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved