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. Bulding / adding subprojects ??
Forum Updated to NodeBB v4.3 + New Features

Bulding / adding subprojects ??

Scheduled Pinned Locked Moved Solved General and Desktop
17 Posts 3 Posters 4.8k Views 2 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.
  • A Anonymous_Banned275

    Just short add

    1. I have successfully added plain C++ class to main project

    2. The new cpp and h files are nowhere to be found in "projects" view

    3. I can no longer add "New.." to main project - no such option...

    4. I can no longer add "New Subproject -> Files and Classes" - no data in view
      ( see #1 This is what I used to add now invisible C++ class to main project)

    5. I can still add New Subproject.

    I am not a happy camper and RTFM no longer helps..

    A Offline
    A Offline
    Anonymous_Banned275
    wrote on last edited by
    #8

    @AnneRanch
    Sorry group , but this is turning into proverbial can of worms.
    Nothing works same each time it is used and seldom the way one expect.
    It looks as adding
    TEMPLATE = subdirs
    in .pro file takes hold after ALL builds are used - I mean "Build" "Run qmake" "Rebuild" - perhaps one of them does it.

    When running just the main project, without adding sub project, I get dialog asking to select executable.

    That would solve the issue I had executing real project with subprojects , but I have no idea WHAT is plain Qt project executable . No .exe - In linux ! How do I know / identify "linux project executable ?" The dialog does not present executable files only so it is up to me know which one it is.

    So _ I expect that there would be ONE executable WHEN there is only main project.

    Then I would expect to be ask to select the executable - main project _ when I add my my first sub project.

    The I get this

    637dac87-3da3-4fb4-b4df-c4194f82eee7-image.png

    OK, there is no executable - BUT how do I get back to the original annoying dialog which let me select one?

    See what I mean ?
    First I get request to select executablee when there is only one ( running main project without adding sub projects) , now I am told there is no executable without slightest hit HOW to add /select one...

    PS
    Note the funky TAB title.

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

      It seems you did not understand the concept behind the subdirs template.

      Each project that composes it is a complete project. It's not a way to structure your files for a single project.

      See for example this tutorial.

      If Qt Creator does not find any executable, then it means that none of your sub-project implements the app template.

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

      A 1 Reply Last reply
      1
      • SGaistS SGaist

        It seems you did not understand the concept behind the subdirs template.

        Each project that composes it is a complete project. It's not a way to structure your files for a single project.

        See for example this tutorial.

        If Qt Creator does not find any executable, then it means that none of your sub-project implements the app template.

        A Offline
        A Offline
        Anonymous_Banned275
        wrote on last edited by Anonymous_Banned275
        #10

        @SGaist

        Here is a clean new " C_Project " "looking for executable "

        bfe43c0d-4d59-40e4-81f6-1c2a2b21e724-image.png No executable specified.

        Which is "executable" ?

        5d20878a-c803-4177-8927-e259ac7110e6-image.png

        Help me solve that first.

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

          Remove the "TEMPLATE = subdirs". You're overwriting the original value.

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

          A 1 Reply Last reply
          0
          • A Offline
            A Offline
            Anonymous_Banned275
            wrote on last edited by
            #12

            Here is normal" run , without the

            TEMPLATE = subdirs

            which enables "New subprogram..."

            My interim conclusion
            enabling "New subprogram " causes the "mising executable".
            I must be missing something else in .pro file

            WHAT is missing ?
            WHY and HOW to fix it ?

            4b06aada-03c6-408f-804a-4faf62350055-image.png

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

              @AnneRanch said in Bulding / adding subprojects ??:

              WHAT is missing ?

              The understanding of how the subdirs template works.

              @AnneRanch said in Bulding / adding subprojects ??:

              WHY and HOW to fix it ?

              For why: to make it work I guess.

              For the how, I already provided a link to a tutorial that explains the concepts and one to a wiki page that also explains how it works.

              So you should start by taking a step back, create a proper subdirs project from scratch and once your have it properly building and running, move back to your project.

              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
              2
              • SGaistS SGaist

                Remove the "TEMPLATE = subdirs". You're overwriting the original value.

                A Offline
                A Offline
                Anonymous_Banned275
                wrote on last edited by
                #14

                @SGaist
                You are the man...
                Sure , makes perfect sense - when app is replaced by subdirs all hell breaks loose.

                So
                TEMPLATE = app needs to be " reinstalled " , preferably in main project..

                I'll go back to the first multi project which still somewhat works to see how
                TEMPLATE = app was handled there.
                There the problem was - the main "executable" somehow connected to the sub project "executable"....

                This will take some time, but I;ll keep you posted .

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

                  First thing: you can't just replace the template type in your application .pro file.

                  The subdirs template requires a structure to be followed. As explained in the links I have posted.

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

                  A 1 Reply Last reply
                  1
                  • SGaistS SGaist

                    First thing: you can't just replace the template type in your application .pro file.

                    The subdirs template requires a structure to be followed. As explained in the links I have posted.

                    A Offline
                    A Offline
                    Anonymous_Banned275
                    wrote on last edited by Anonymous_Banned275
                    #16

                    @SGaist said in Bulding / adding subprojects ??:

                    @AnneRanch said in Bulding / adding subprojects ??:

                    WHAT is missing ?

                    The understanding of how the subdirs template works.

                    Yes, looks as the whole concept of "subproject" is good for what I wanted - be able to load multiple projects .

                    The only weird issue is the the "main project" is actually one, preferably the first "subproject".
                    But it will do.

                    SOLVED / CORRECTION
                    The basic Qt "subproject" concept is to have multiple projects "under one roof".
                    Unfortunately some tutorials concentrate on expanding this simple, primarily administrative concept thus making the implementation far more complicated then it is .

                    When one follows these tutorials , as I did , the QtCreator implementation is completely covered and it leads to few dead ends.

                    Here is my conclusion:

                    Start with :

                    1. New File or Project -> Other Project ->Subdirs Project
                      then use
                    2. project -> "New Subproject..." and select desired project type

                    finally use
                    Run
                    3. and your newly added FIRST (sub) project will (build and ) execute.

                    repeat step 2 3 as necessary

                    1. code / debug each added sub project as you would any other SINGLE project.

                    2. Qt will build / rebuild every sub project as necessary.

                    Essentially all is needed is to know to implement this scheme

                    TEMPLATE is your friend

                    In closing I really appreciate all the help received from the discussion participants.

                    PS
                    Like to hear from anybody who successfully Imported existing sub project using the "new subproject... " options.

                    1 Reply Last reply
                    0
                    • NevezN Offline
                      NevezN Offline
                      Nevez
                      wrote on last edited by
                      #17

                      @AnneRanch
                      you are a great person. I searched many sites all day long. However, I was more confused about what to do. After reading and applying what in your last post, I've literally succeeded. Really thank you so much. Have a nice day..

                      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