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. Project Dependencies?
Qt 6.11 is out! See what's new in the release blog

Project Dependencies?

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 1.6k 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    Hi everybody,

    Maybe it is a very simple problem, but i still don't get it!

    I have the following situation:

    2 Projects:

    ProjectA and ProjectB

    ProjectA is a pure framework and ProjectB should just use this framework.

    I just opened the project settings of ProjectB -> dependencies and checked the box of ProjectA.
    So far so good. If I build ProjectB, ProjectA compiles first. (Also good!)

    BUT: How can I simply use the classes/headers from ProjectA in ProjectB? Is there another way but adding every file of ProjectA in the .pro file of ProjectB???

    I used to do that with Eclipse. There u just have to set the dependencies and you can use the classes and headers...

    The compiler recognizes the complete files of ProjectA that are required. But Make says smth like: No rule to make target "xxx.cpp" needed by "xxx.o"!

    I also tried the SUBDIRS option in the .pro file of ProjectB. No change...

    I'm using MinGW if that helps...

    Big Thanks in advice!

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      A standard approach would to build ProjectA as a library (or several libraries), and then add them to ProjectB through standard vars in qmake:
      @
      LIBS += yourlib
      INCLUDEPATH += yourlibHeaders
      @

      And use those libs in ProjectB.

      (Z(:^

      1 Reply Last reply
      0
      • ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #3

        Does yourlibHeaders work recursive?
        Because my project consists of sub directories! And then i would have to add all the headers manually...?

        1 Reply Last reply
        0
        • ? Offline
          ? Offline
          A Former User
          wrote on last edited by
          #4

          The most fool-proof approach is most likely to add a new .pro file using the subdirs template that references your two existing projects. That effectively fuse your two projects into one.

          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