Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. QT Creator "subdirs" project gui & projects libs
Forum Update on Monday, May 27th 2025

QT Creator "subdirs" project gui & projects libs

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
4 Posts 3 Posters 631 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.
  • C Offline
    C Offline
    Claudio Silva
    wrote on 10 Aug 2018, 21:04 last edited by
    #1

    Re: QT Creator "subdirs" project

    Hi everyone, I have a very good question, how can I make the .lib link in the gui project?

    https://drive.google.com/open?id=1tG0hYCo8WBYBCAwC-ts_PAQUH8DObmsU

    C 1 Reply Last reply 10 Aug 2018, 22:47
    0
    • C Claudio Silva
      10 Aug 2018, 21:04

      Re: QT Creator "subdirs" project

      Hi everyone, I have a very good question, how can I make the .lib link in the gui project?

      https://drive.google.com/open?id=1tG0hYCo8WBYBCAwC-ts_PAQUH8DObmsU

      C Offline
      C Offline
      Claudio Silva
      wrote on 10 Aug 2018, 22:47 last edited by
      #2

      @Claudio-Silva
      the solution to import .lib into a project and use $$OUT_PWD

      INCLUDEPATH += ../lib
      INCLUDEPATH += ../lib2
      LIBS += $$OUT_PWD/../lib/release/lib.lib
      LIBS += $$OUT_PWD/../lib2/release/lib2.lib
      
      A K 2 Replies Last reply 11 Aug 2018, 05:25
      1
      • C Claudio Silva
        10 Aug 2018, 22:47

        @Claudio-Silva
        the solution to import .lib into a project and use $$OUT_PWD

        INCLUDEPATH += ../lib
        INCLUDEPATH += ../lib2
        LIBS += $$OUT_PWD/../lib/release/lib.lib
        LIBS += $$OUT_PWD/../lib2/release/lib2.lib
        
        A Offline
        A Offline
        aha_1980
        Lifetime Qt Champion
        wrote on 11 Aug 2018, 05:25 last edited by
        #3

        @Claudio-Silva

        There might be a better way, more cross platform. Given your libraries are called libOne.lib and libTwo.lib, the lines would look like this:

        LIBS += -L$$OUT_PWD/../lib/release -lOne
        LIBS += -L$$OUT_PWD/../lib2/release -lTwo
        

        The advantage here is (for shared libraries, you had static ones in your project), that QtCreator automatically extends the library search path when you run your app so it will find all libs.

        Regards

        Qt has to stay free or it will die.

        1 Reply Last reply
        1
        • C Claudio Silva
          10 Aug 2018, 22:47

          @Claudio-Silva
          the solution to import .lib into a project and use $$OUT_PWD

          INCLUDEPATH += ../lib
          INCLUDEPATH += ../lib2
          LIBS += $$OUT_PWD/../lib/release/lib.lib
          LIBS += $$OUT_PWD/../lib2/release/lib2.lib
          
          K Offline
          K Offline
          kshegunov
          Moderators
          wrote on 11 Aug 2018, 11:14 last edited by
          #4

          In addition you may want to add them to PRE_TARGETDEPS.

          Read and abide by the Qt Code of Conduct

          1 Reply Last reply
          0

          1/4

          10 Aug 2018, 21:04

          • Login

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