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. where compiler and kit info is saved

where compiler and kit info is saved

Scheduled Pinned Locked Moved Unsolved General and Desktop
12 Posts 3 Posters 2.1k 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.
  • R Offline
    R Offline
    ravi2k18
    wrote on last edited by ravi2k18
    #1

    Hi,

    I have written a simple hello project using qt creator using msvc compilers. And trying to import the same as existing project,
    after deleting pro.user and generated makefiles. however while writing the project i see build section has qmake and nmake entry under the project setting. while importing the same project as a existing one, I do not see qmake entry in build settings. Can any one tell me how can we save qmake , nmake locations, toolkit info and settings in the project so that while importing the project next time I do not need to set all these things once again and just opening .pro file in qtcreater should set these exactly the same when I was writing the project as new one? I am using the same machine for writing and importing the project.

    thanks

    jsulmJ 1 Reply Last reply
    0
    • R ravi2k18

      Hi,

      I have written a simple hello project using qt creator using msvc compilers. And trying to import the same as existing project,
      after deleting pro.user and generated makefiles. however while writing the project i see build section has qmake and nmake entry under the project setting. while importing the same project as a existing one, I do not see qmake entry in build settings. Can any one tell me how can we save qmake , nmake locations, toolkit info and settings in the project so that while importing the project next time I do not need to set all these things once again and just opening .pro file in qtcreater should set these exactly the same when I was writing the project as new one? I am using the same machine for writing and importing the project.

      thanks

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by jsulm
      #2

      @ravi2k18 said in where compiler and kit info is saved:

      how can we save qmake , nmake locations, toolkit info and settings in the project so that while importing the project next time

      You should not do that as it can be different on different machines!
      When opening the project in QtCreator you simply need to select a proper Kit, that's all.
      And if you're working on the same machine why do you need to import your project so often?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • R Offline
        R Offline
        ravi2k18
        wrote on last edited by
        #3

        @jsulm

        if you're working on the same machine why do you need to import your project so often?

        I have work on a existing project to which I need to import, but it is giving me lots of errors. so I thought to write a simple test program and import just to know the root cause of my failures.

        When opening the project in QtCreator you simply need to select a proper Kit.

        Is there a way to write a settings/info of kit in the project. I mean if I have to ship the source code how second person will know about the kits required for building? how will he come to know if the project is written with VS 2015 , 2016, mingw etc and with what setting.

        this is happening in my case even though machine and tools are same.

        thanks.....

        jsulmJ 1 Reply Last reply
        0
        • R ravi2k18

          @jsulm

          if you're working on the same machine why do you need to import your project so often?

          I have work on a existing project to which I need to import, but it is giving me lots of errors. so I thought to write a simple test program and import just to know the root cause of my failures.

          When opening the project in QtCreator you simply need to select a proper Kit.

          Is there a way to write a settings/info of kit in the project. I mean if I have to ship the source code how second person will know about the kits required for building? how will he come to know if the project is written with VS 2015 , 2016, mingw etc and with what setting.

          this is happening in my case even though machine and tools are same.

          thanks.....

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by jsulm
          #4

          @ravi2k18 said in where compiler and kit info is saved:

          but it is giving me lots of errors

          In this case something is wrong on the machine where you're importing. Storing project settings will not help you. What errors do you get? Do you have a valid Kit?

          It doesn't make sense to to store Kit configuration in your project. Because the Kit must be there when importing a project. So, Kit is something the development machine must have in order to be able to load a project.
          A Kit is simply a collection of a compiler and matching Qt version. If one of these things is missing you do not have a working Kit. If for example you do not have Qt matching your compiler then you will not be able to load a project even if you store Kit information inside the project (how can this information install missing Qt?).

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          3
          • R Offline
            R Offline
            ravi2k18
            wrote on last edited by ravi2k18
            #5

            @jsulm

            Please see the message in qt creator while importing the existing qmake project.
            It has no option to support qmake cmake etc. this is what is creating problem in my exiting qmake project.
            do we have any option to import qmake projects?

            while writing hello project, I choose empty qmake project option and fill up with my code. however while importing the same project I do not have qmake support.

            0_1547470839280_Screenshot from 2019-01-14 18-27-42.jpg

            jsulmJ 1 Reply Last reply
            0
            • R ravi2k18

              @jsulm

              Please see the message in qt creator while importing the existing qmake project.
              It has no option to support qmake cmake etc. this is what is creating problem in my exiting qmake project.
              do we have any option to import qmake projects?

              while writing hello project, I choose empty qmake project option and fill up with my code. however while importing the same project I do not have qmake support.

              0_1547470839280_Screenshot from 2019-01-14 18-27-42.jpg

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @ravi2k18 There is no need to import a qmake based project - simply open it "File/Open File or Project...".

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              2
              • R Offline
                R Offline
                ravi2k18
                wrote on last edited by
                #7

                thanks @jsulm it works.

                BTW I have a doubt on qmake project,
                what if someone has written a qmake project under linux qt.
                and if any one else wants to use that project under windows with MSVC. How come the c++ (originally written for linux) source will compile in visual studio? Is the qt framework for linux and windows are exactly same? what about native c++ source code ?

                once again thanks for helping me.....

                jsulmJ J.HilkJ 2 Replies Last reply
                0
                • R ravi2k18

                  thanks @jsulm it works.

                  BTW I have a doubt on qmake project,
                  what if someone has written a qmake project under linux qt.
                  and if any one else wants to use that project under windows with MSVC. How come the c++ (originally written for linux) source will compile in visual studio? Is the qt framework for linux and windows are exactly same? what about native c++ source code ?

                  once again thanks for helping me.....

                  jsulmJ Offline
                  jsulmJ Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  @ravi2k18 This is exactly why you should NOT store Kits inside your project!
                  Usually you simply open your project, written on Linux, on Windows in QtCreator and build. You just need to make sure you have a working Kit on Windows. Sometimes some differences needs to be considered, but this is done inside the pro file.

                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  3
                  • R ravi2k18

                    thanks @jsulm it works.

                    BTW I have a doubt on qmake project,
                    what if someone has written a qmake project under linux qt.
                    and if any one else wants to use that project under windows with MSVC. How come the c++ (originally written for linux) source will compile in visual studio? Is the qt framework for linux and windows are exactly same? what about native c++ source code ?

                    once again thanks for helping me.....

                    J.HilkJ Offline
                    J.HilkJ Offline
                    J.Hilk
                    Moderators
                    wrote on last edited by J.Hilk
                    #9

                    @ravi2k18 to expand a bit to what @jsulm said

                    One of the strength of the Qt-Framework is it's cross platform compatibility.
                    That means except from a few os-specific quirks, you do not have to change very little when porting to other platforms, if you stick with the Qt_Libary and pure c/cpp code.

                    If you have platfrom specific classes / code segments, than Qt comes with a few handy defines.

                    //inside the *.pro file
                    win32{
                    ....
                    }
                     macx{
                    ....
                    }
                    
                    ios {
                    ...
                    }
                    
                    android{
                    ...
                    }
                    //etc
                    

                    inside classes:

                    #if defined (Q_OS_ANDROID)
                    ...
                    #if defined(Q_OS_WIN) 
                    ...
                    #if defined(Q_OS_MACOS)
                    //etc
                    

                    For more information see here:
                    http://doc.qt.io/qt-5/qtglobal.html#Macros


                    Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


                    Q: What's that?
                    A: It's blue light.
                    Q: What does it do?
                    A: It turns blue.

                    1 Reply Last reply
                    4
                    • R Offline
                      R Offline
                      ravi2k18
                      wrote on last edited by
                      #10

                      @jsulm

                      does it mean, qmake will generate different makefiles in windows and linux (optimised and configured based on the OS compilers and used kit) for the same .pro file?

                      what about the native c++ code ? is it developers resposibity to write a code supporting both the OS?

                      jsulmJ 1 Reply Last reply
                      0
                      • R ravi2k18

                        @jsulm

                        does it mean, qmake will generate different makefiles in windows and linux (optimised and configured based on the OS compilers and used kit) for the same .pro file?

                        what about the native c++ code ? is it developers resposibity to write a code supporting both the OS?

                        jsulmJ Offline
                        jsulmJ Offline
                        jsulm
                        Lifetime Qt Champion
                        wrote on last edited by jsulm
                        #11

                        @ravi2k18 Yes and Yes.
                        It is your responsibility to write platform independent C++ code. Qt helps here as its APIs are platform independent. But if you, for example use Windows API, then this code will only work on Windows. In such cases you can do what @J-Hilk showed.

                        https://forum.qt.io/topic/113070/qt-code-of-conduct

                        1 Reply Last reply
                        2
                        • R Offline
                          R Offline
                          ravi2k18
                          wrote on last edited by
                          #12

                          thanks @jsulm and @J-Hilk I really appreciate your help.

                          After spending 4 sleepless nights on this, I now got my answer.

                          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