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. Default project fails
Forum Updated to NodeBB v4.3 + New Features

Default project fails

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
21 Posts 3 Posters 2.9k 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.
  • J jimbrownqtuser

    I'm using Qt5. Is it possible Qt Creator needs Qt6?

    qtchooser -list-versions
    4
    5
    default
    qt4-x86_64-linux-gnu
    qt4
    qt5-x86_64-linux-gnu
    qt5
    
    
    JonBJ Offline
    JonBJ Offline
    JonB
    wrote on last edited by
    #11

    @jimbrownqtuser
    I am still not certain where you are at.

    Creator is built with some version of Qt, be that, say, Qt5 or Qt6. It comes with all the libraries it needs from that version inside the Creator executable area --- have a look where that is and you should find all its shared libraries there or nearby. So it is self-contained, and does not care/is independent from what version of Qt you have installed for building your projects with. They are customarily the same, but do not have to be, so a Qt6 Creator could build a Qt5 application or vice versa.

    If I understand right, you create a project on one machine under one version of Ubuntu, you can build and run it. If you take the executable to a different machine with different version of Ubuntu it also runs. But if you take the .pro and sources they do not read in as a project in Creator on the other machine.

    Then again, I don't quite get

    To be clear, Qt Creator on Ubuntu 24.04 creates a correct project which if moved to Ubuntu 22.04 runs and can be debugged with Qt Creator on that system. It is not recognized on the 24.04 system as a valid project with contents even though it was constructed there.

    How did you create a correct project under 24.04 in the first place if it's not recognised as a valid project? I don't get that, it would have to be a valid project while you are interacting with Creator to create it?

    FWIW, I also asked you earlier what versions of Creator you installed/created on the two systems but you did not reply. You can see from within Creator from the Help menu. I would not expect the versions of Creator fetched via apt under the differing versions of Ubuntu to be the same.

    Can't we eliminate any discussion of 24.04 and moving files between machines? Can you create a project from scratch (not by copying files) under 24.04 and it goes wrong? How do you succeed in adding files to this project in Creator to create it if at the same time you tell us that it doesn't create a project/show the files?

    Are you wedded to Qt5? I can say that installing and using Qt6 under 24.04 works. I have not tried to install and run Qt5 under 24.04. Not to say it should not work, but it would be interesting to know whether that works instead.

    1 Reply Last reply
    0
    • J jimbrownqtuser

      I reinstalled Ubuntu 24.04 from scratch and entered these two lines

      apt-get -y install qtbase5-dev qt5-qmake 
      apt-get -y install qtcreator
      

      The project is created correctly but Qt Creator fails the same way.

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #12

      @jimbrownqtuser
      P.S.
      One thought. It would not apply if things go wrong solely on one machine, but might if you are trying to move projects between Qts. Don't forget that Creator offers two different build systems. At Qt5 the default was qmake (uses .pro file) but at Qt6 the default was moved to cmake (uses CMakeLists file). If using cmake you won't be able to read a .pro file as a project.....

      1 Reply Last reply
      0
      • J Offline
        J Offline
        jimbrownqtuser
        wrote on last edited by
        #13

        I appreciate your willingness to help. I described some experiments that I did to try to understand what's going on and I see that confused the issue.

        I'll try to answer all the questions but first I have a simple reproducible case that is only on Ubuntu 24.04 and doesn't involve any file not provided by the system.

        1. The simple case

        I did a minimal install of Ubuntu 24.04.

        Make sure it's up to date

        apt update
        apt upgrade
        

        Install Qt stuff

        apt-get -y install qtbase5-dev qt5-qmake
        apt-get -y install qtchooser
        apt-get -y install qtcreator
        

        Check that Qt is installed

        .../jimbrown:qtchooser -list-versions
        4
        5
        default
        qt4-x86_64-linux-gnu
        qt4
        qt5-x86_64-linux-gnu
        qt5
        

        See where headers are located

        .../jimbrown:qmake -query QT_INSTALL_HEADERS
        /usr/include/x86_64-linux-gnu/qt5
        

        Make sure qmake is available

        .../jimbrown:find /usr/lib -name qmake
        /usr/lib/qt5/bin/qmake
        /usr/lib/x86_64-linux-gnu/qt5/bin/qmake
        

        I notice no qmake for qt4 but I don't think it matters.

        reboot the system

        Run QT Creator

        Create project by pressing "Create Project" green button.

        Application (Qt) / Qt Widgets Application / Choose
        Name: ttt in /home/jimbrown
        Next - Build system: qmake
        Next / Next / Next/ Next

        It shows that files will be added

        FilesAdded.png

        Press "Finish"

        This shows that although it says there is a project named ttt and a file ttt.pro, there are no Headers, Source or Forms. It also says "This file is not part of any project. ..."

        qtcreator2.png

        That's the failure.

        The files it says it would create are created:

        ~/ttt:ls
        main.cpp  mainwindow.cpp  mainwindow.h  mainwindow.ui  ttt.pro  ttt.pro.user
        

        That's the end of the case.

        1. Questions that you asked or additional comments.

        If I move the ttt directory and it's content to an earlier version of Ubuntu, Qt Creator recognizes the project correctly and can build and run it.

        Thanks for explaining that a Qt6 Creator could build a Qt5 application or vice versa. I wanted to eliminate that as a possible source of the problem.

        You asked "How did you create a correct project under 24.04 in the first place if it's not recognized as a valid project?"

        As I explained above, the project is created correctly. But Creator does not appear to recognize it. So on 24.04, I cannot build an executable program. On earlier versions of Ubuntu, those same files work.

        Qt Creator is version 13.0.0

        I do want to use Qt5 because I'm hoping to get a paying job early next year with a company that uses Qt5. They are currently on Ubuntu 20.04 but I expect them to move to a newer version and I want to be ready.

        Thanks again for your help.

        Pl45m4P JonBJ 2 Replies Last reply
        1
        • J jimbrownqtuser

          I appreciate your willingness to help. I described some experiments that I did to try to understand what's going on and I see that confused the issue.

          I'll try to answer all the questions but first I have a simple reproducible case that is only on Ubuntu 24.04 and doesn't involve any file not provided by the system.

          1. The simple case

          I did a minimal install of Ubuntu 24.04.

          Make sure it's up to date

          apt update
          apt upgrade
          

          Install Qt stuff

          apt-get -y install qtbase5-dev qt5-qmake
          apt-get -y install qtchooser
          apt-get -y install qtcreator
          

          Check that Qt is installed

          .../jimbrown:qtchooser -list-versions
          4
          5
          default
          qt4-x86_64-linux-gnu
          qt4
          qt5-x86_64-linux-gnu
          qt5
          

          See where headers are located

          .../jimbrown:qmake -query QT_INSTALL_HEADERS
          /usr/include/x86_64-linux-gnu/qt5
          

          Make sure qmake is available

          .../jimbrown:find /usr/lib -name qmake
          /usr/lib/qt5/bin/qmake
          /usr/lib/x86_64-linux-gnu/qt5/bin/qmake
          

          I notice no qmake for qt4 but I don't think it matters.

          reboot the system

          Run QT Creator

          Create project by pressing "Create Project" green button.

          Application (Qt) / Qt Widgets Application / Choose
          Name: ttt in /home/jimbrown
          Next - Build system: qmake
          Next / Next / Next/ Next

          It shows that files will be added

          FilesAdded.png

          Press "Finish"

          This shows that although it says there is a project named ttt and a file ttt.pro, there are no Headers, Source or Forms. It also says "This file is not part of any project. ..."

          qtcreator2.png

          That's the failure.

          The files it says it would create are created:

          ~/ttt:ls
          main.cpp  mainwindow.cpp  mainwindow.h  mainwindow.ui  ttt.pro  ttt.pro.user
          

          That's the end of the case.

          1. Questions that you asked or additional comments.

          If I move the ttt directory and it's content to an earlier version of Ubuntu, Qt Creator recognizes the project correctly and can build and run it.

          Thanks for explaining that a Qt6 Creator could build a Qt5 application or vice versa. I wanted to eliminate that as a possible source of the problem.

          You asked "How did you create a correct project under 24.04 in the first place if it's not recognized as a valid project?"

          As I explained above, the project is created correctly. But Creator does not appear to recognize it. So on 24.04, I cannot build an executable program. On earlier versions of Ubuntu, those same files work.

          Qt Creator is version 13.0.0

          I do want to use Qt5 because I'm hoping to get a paying job early next year with a company that uses Qt5. They are currently on Ubuntu 20.04 but I expect them to move to a newer version and I want to be ready.

          Thanks again for your help.

          Pl45m4P Offline
          Pl45m4P Offline
          Pl45m4
          wrote on last edited by Pl45m4
          #14

          @jimbrownqtuser said in Default project fails:

          The files it says it would create are created:

          Hi, show the content of your ttt.pro file please.
          Ah nvm, it is posted above already :D
          It doesn't look wrong...

          Are you able to create CMake projects with QtCreator? Do they show a proper structure in QtCreator?


          If debugging is the process of removing software bugs, then programming must be the process of putting them in.

          ~E. W. Dijkstra

          1 Reply Last reply
          0
          • J Offline
            J Offline
            jimbrownqtuser
            wrote on last edited by
            #15

            I tried making the default app with cmake. Same result "This file is not part of any project. ..."

            1 Reply Last reply
            0
            • J jimbrownqtuser

              I appreciate your willingness to help. I described some experiments that I did to try to understand what's going on and I see that confused the issue.

              I'll try to answer all the questions but first I have a simple reproducible case that is only on Ubuntu 24.04 and doesn't involve any file not provided by the system.

              1. The simple case

              I did a minimal install of Ubuntu 24.04.

              Make sure it's up to date

              apt update
              apt upgrade
              

              Install Qt stuff

              apt-get -y install qtbase5-dev qt5-qmake
              apt-get -y install qtchooser
              apt-get -y install qtcreator
              

              Check that Qt is installed

              .../jimbrown:qtchooser -list-versions
              4
              5
              default
              qt4-x86_64-linux-gnu
              qt4
              qt5-x86_64-linux-gnu
              qt5
              

              See where headers are located

              .../jimbrown:qmake -query QT_INSTALL_HEADERS
              /usr/include/x86_64-linux-gnu/qt5
              

              Make sure qmake is available

              .../jimbrown:find /usr/lib -name qmake
              /usr/lib/qt5/bin/qmake
              /usr/lib/x86_64-linux-gnu/qt5/bin/qmake
              

              I notice no qmake for qt4 but I don't think it matters.

              reboot the system

              Run QT Creator

              Create project by pressing "Create Project" green button.

              Application (Qt) / Qt Widgets Application / Choose
              Name: ttt in /home/jimbrown
              Next - Build system: qmake
              Next / Next / Next/ Next

              It shows that files will be added

              FilesAdded.png

              Press "Finish"

              This shows that although it says there is a project named ttt and a file ttt.pro, there are no Headers, Source or Forms. It also says "This file is not part of any project. ..."

              qtcreator2.png

              That's the failure.

              The files it says it would create are created:

              ~/ttt:ls
              main.cpp  mainwindow.cpp  mainwindow.h  mainwindow.ui  ttt.pro  ttt.pro.user
              

              That's the end of the case.

              1. Questions that you asked or additional comments.

              If I move the ttt directory and it's content to an earlier version of Ubuntu, Qt Creator recognizes the project correctly and can build and run it.

              Thanks for explaining that a Qt6 Creator could build a Qt5 application or vice versa. I wanted to eliminate that as a possible source of the problem.

              You asked "How did you create a correct project under 24.04 in the first place if it's not recognized as a valid project?"

              As I explained above, the project is created correctly. But Creator does not appear to recognize it. So on 24.04, I cannot build an executable program. On earlier versions of Ubuntu, those same files work.

              Qt Creator is version 13.0.0

              I do want to use Qt5 because I'm hoping to get a paying job early next year with a company that uses Qt5. They are currently on Ubuntu 20.04 but I expect them to move to a newer version and I want to be ready.

              Thanks again for your help.

              JonBJ Offline
              JonBJ Offline
              JonB
              wrote on last edited by
              #16

              @jimbrownqtuser said in Default project fails:

              You asked "How did you create a correct project under 24.04 in the first place if it's not recognized as a valid project?"

              As I explained above, the project is created correctly. But Creator does not appear to recognize it. So on 24.04, I cannot build an executable program. On earlier versions of Ubuntu, those same files work.

              You are now very clear about what you see. Creator lets you create a project, creates the .pro and source files, yet does not recognise it as a project. I have not seen this before so I don't know. Check it has found proper Kits?

              Like I said, I have Qt6 installed same way under 24.04 and that's fine. I don't know if the problem is because you are using Qt5 or whether that is not relevant.

              1 Reply Last reply
              0
              • J Offline
                J Offline
                jimbrownqtuser
                wrote on last edited by
                #17

                Checking kits is a good idea. I'm not sure what to check for. HERE'S WHAT i see:
                kits.png

                1 Reply Last reply
                0
                • J Offline
                  J Offline
                  jimbrownqtuser
                  wrote on last edited by
                  #18

                  I can't reproduce it but looking at the kits I got a pop-up like you would get with mouse button 2 and it said under compiler - clang. Certainly not what I want. I don't understand kits and don't know what to do. But it's a lead. Thanks

                  Pl45m4P 1 Reply Last reply
                  0
                  • J jimbrownqtuser

                    I can't reproduce it but looking at the kits I got a pop-up like you would get with mouse button 2 and it said under compiler - clang. Certainly not what I want. I don't understand kits and don't know what to do. But it's a lead. Thanks

                    Pl45m4P Offline
                    Pl45m4P Offline
                    Pl45m4
                    wrote on last edited by
                    #19

                    @jimbrownqtuser said in Default project fails:

                    I don't understand kits

                    A kit is the set of tools you use to develop/build your app within QtCreator. It contains compiler, debugger and run/build settings.

                    It's weird to see this empty... So QtCreator does not seem to recognize your Qt installation


                    If debugging is the process of removing software bugs, then programming must be the process of putting them in.

                    ~E. W. Dijkstra

                    1 Reply Last reply
                    0
                    • J Offline
                      J Offline
                      jimbrownqtuser
                      wrote on last edited by
                      #20

                      Solved!

                      The solution was to change the desktop kit so the C++ compiler was GCC instead of CLANG. The C compiler was already set to GCC.

                      The default app now shows all the files, is recognized as a project and runs.

                      The suggestion "Check it has found proper Kits?" was the clue that led me to this solution. If I had more experience with Qt maybe I would have thought of that. I certainly didn't suspect that if you had a different compiler selected in the kit that the project display would not show Headers, Sources and Forms.

                      I read the documentation on kits and learned how to create and modify kits.

                      Thanks to those who helped. I would not have solved this without you.

                      JonBJ 1 Reply Last reply
                      1
                      • J jimbrownqtuser

                        Solved!

                        The solution was to change the desktop kit so the C++ compiler was GCC instead of CLANG. The C compiler was already set to GCC.

                        The default app now shows all the files, is recognized as a project and runs.

                        The suggestion "Check it has found proper Kits?" was the clue that led me to this solution. If I had more experience with Qt maybe I would have thought of that. I certainly didn't suspect that if you had a different compiler selected in the kit that the project display would not show Headers, Sources and Forms.

                        I read the documentation on kits and learned how to create and modify kits.

                        Thanks to those who helped. I would not have solved this without you.

                        JonBJ Offline
                        JonBJ Offline
                        JonB
                        wrote on last edited by JonB
                        #21

                        @jimbrownqtuser said in Default project fails:

                        The solution was to change the desktop kit so the C++ compiler was GCC instead of CLANG.

                        Indeed! I can only say that my 24.04 installation (with Qt6) did this already, I never had a problem.
                        It's obviously not helpful that it creates a project yet then cannot handle it.

                        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