Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved QT Creator "subdirs" project gui & projects libs

    Tools
    3
    4
    407
    Loading More Posts
    • 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
      Claudio Silva last edited by

      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 Reply Quote 0
      • C
        Claudio Silva @Claudio Silva last edited by

        @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
        
        aha_1980 kshegunov 2 Replies Last reply Reply Quote 1
        • aha_1980
          aha_1980 Lifetime Qt Champion @Claudio Silva last edited by

          @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 Reply Quote 1
          • kshegunov
            kshegunov Moderators @Claudio Silva last edited by

            In addition you may want to add them to PRE_TARGETDEPS.

            Read and abide by the Qt Code of Conduct

            1 Reply Last reply Reply Quote 0
            • First post
              Last post