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. [Solved]how to add dependency to a lib?
Forum Updated to NodeBB v4.3 + New Features

[Solved]how to add dependency to a lib?

Scheduled Pinned Locked Moved Qt Creator and other tools
6 Posts 3 Posters 5.0k Views 1 Watching
  • 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
    twicave
    wrote on last edited by
    #1

    I found when my *.lib is re-created, the main project will not auto-build.
    How to add dependency to a lib file in .pro?

    1 Reply Last reply
    0
    • T Offline
      T Offline
      tilsitt
      wrote on last edited by
      #2

      Hi,

      Does "this":http://qt-project.org/doc/qt-4.8/qmake-environment-reference.html#libdepend help?

      1 Reply Last reply
      0
      • T Offline
        T Offline
        twicave
        wrote on last edited by
        #3

        thanks a lot.But it's not the answer of my question.

        what I mean is :

        when project is very large. you need sepreate it into modules. the "module" is a lib.
        when you modify lib's source code, qt creator cannot make the root project auto-build.
        That is what I called "dependency" to a .lib.

        BTW, I have tried the method you applied. It doesn't work either.

        1 Reply Last reply
        0
        • T Offline
          T Offline
          twicave
          wrote on last edited by
          #4

          no one know the answer? I can not believe that.
          It is a very important feature for a building system.
          When I first meet this problem, I was so surprising.

          Here is my solution, now:
          Delete the main output file every time, when you build project.

          1 Reply Last reply
          0
          • Chris KawaC Online
            Chris KawaC Online
            Chris Kawa
            Lifetime Qt Champion
            wrote on last edited by
            #5

            Well, the first (obvious) thing is to set dependencies in Project->Dependencies section. This will assure correct build order, but will not force your app to re-link on lib changes.
            To achieve this adding this to the .pro file works for me:
            @
            PRE_TARGETDEPS += <path and name of your lib>
            @

            1 Reply Last reply
            0
            • T Offline
              T Offline
              twicave
              wrote on last edited by
              #6

              thanks a lot krzysztof.
              It works.

              But why qmake doesn't auto add dependency to it's libs:
              through "LIBS +="?
              can anybody from QT explain the reason?

              1 Reply Last reply
              0

              • Login

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