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. Add Project to Another Project
QtWS25 Last Chance

Add Project to Another Project

Scheduled Pinned Locked Moved Unsolved General and Desktop
9 Posts 4 Posters 681 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.
  • O Offline
    O Offline
    ofmrew
    wrote on last edited by
    #1

    I have a project that contains classes that are underdevelopment and I want to use those classes in other projects. Moreover, I what any changes I make in another project using those classes to be reflected in the original project. My problem is there id no consistency. I found two ways to do what I want, but they sometime work and other times they do not.

    Method 1. Modify the .pro file to add the header and source files. When I do this I should be shown the path to the original project and all of the source and header file below. In the path I get that, but today only noe file shows.

    Method 2. Months ago with an older version of Creator I used the add new>add existing directory to accomplish the same thing, but that no longer works.

    My question is what is the correct way to do what I want to do?

    1 Reply Last reply
    0
    • JoeCFDJ Offline
      JoeCFDJ Offline
      JoeCFD
      wrote on last edited by
      #2

      you can build this project into a dynamic or static library and link it to other projects.

      1 Reply Last reply
      0
      • O Offline
        O Offline
        ofmrew
        wrote on last edited by
        #3

        Yes, but that defeats my objective of continued development .

        M 1 Reply Last reply
        0
        • O ofmrew

          Yes, but that defeats my objective of continued development .

          M Offline
          M Offline
          mpergand
          wrote on last edited by
          #4

          @ofmrew
          Bundle these files in a .pri file,
          and include it in each of your .pro with:
          include(path/xxx.pri)

          O 1 Reply Last reply
          0
          • M mpergand

            @ofmrew
            Bundle these files in a .pri file,
            and include it in each of your .pro with:
            include(path/xxx.pri)

            O Offline
            O Offline
            ofmrew
            wrote on last edited by
            #5

            @mpergand Thank you very much. I will try this and post the results. Again thanks?

            O 1 Reply Last reply
            0
            • O ofmrew

              @mpergand Thank you very much. I will try this and post the results. Again thanks?

              O Offline
              O Offline
              ofmrew
              wrote on last edited by
              #6

              @ofmrew
              I get the message ":-1: error: Cannot read /home/bob/GravitationalAssist/..\home\bob\My3DLib.pri: No such file or directory"

              In the .pro file is "include(..\home\bob\My3DLib.pri)"

              And the file is at that location and contains:
              SOURCES +=
              ../My3DLib/FreeFun.cpp
              ../My3DLib/StateVariable.cpp
              ../My3DLib/Vector3.cpp
              ../My3DLib/Vector4.cpp
              ../My3DLib/Matrix3x3.cpp
              ../My3DLib/Matrix4x4.cpp

              HEADERS +=
              ../My3DLib/FreeFun.h
              ../My3DLib/StateVariable.h
              ../My3DLib/Vector3.h
              ../My3DLib/Vector4.h
              ../My3DLib/Matrix3x3.h
              ../My3DLib/Matrix4x4.h

              What do I need?

              M 1 Reply Last reply
              0
              • O ofmrew

                @ofmrew
                I get the message ":-1: error: Cannot read /home/bob/GravitationalAssist/..\home\bob\My3DLib.pri: No such file or directory"

                In the .pro file is "include(..\home\bob\My3DLib.pri)"

                And the file is at that location and contains:
                SOURCES +=
                ../My3DLib/FreeFun.cpp
                ../My3DLib/StateVariable.cpp
                ../My3DLib/Vector3.cpp
                ../My3DLib/Vector4.cpp
                ../My3DLib/Matrix3x3.cpp
                ../My3DLib/Matrix4x4.cpp

                HEADERS +=
                ../My3DLib/FreeFun.h
                ../My3DLib/StateVariable.h
                ../My3DLib/Vector3.h
                ../My3DLib/Vector4.h
                ../My3DLib/Matrix3x3.h
                ../My3DLib/Matrix4x4.h

                What do I need?

                M Offline
                M Offline
                mpergand
                wrote on last edited by mpergand
                #7

                @ofmrew said in Add Project to Another Project:

                In the .pro file is "include(..\home\bob\My3DLib.pri)"

                Obsiously the path is wrong.
                Show your files hierarchy structure.

                O 1 Reply Last reply
                0
                • M mpergand

                  @ofmrew said in Add Project to Another Project:

                  In the .pro file is "include(..\home\bob\My3DLib.pri)"

                  Obsiously the path is wrong.
                  Show your files hierarchy structure.

                  O Offline
                  O Offline
                  ofmrew
                  wrote on last edited by
                  #8

                  @mpergand
                  I see my problem: include(..\home\bob\My3DLib.pri) should be include(\home\bob\My3DLib.pri)

                  But I found what I was looking for: you can create a .pri file in Creator, see link text.

                  Now I just need to find the format of the .pri file.

                  Thanks for your help.

                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    Hi,

                    You should stop using backslashes for your paths especially on non Windows platform.

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    1

                    • Login

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