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. Edited source didnt get recognized
Forum Updated to NodeBB v4.3 + New Features

Edited source didnt get recognized

Scheduled Pinned Locked Moved Unsolved General and Desktop
13 Posts 4 Posters 862 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.
  • SGaistS Offline
    SGaistS Offline
    SGaist
    Lifetime Qt Champion
    wrote on last edited by
    #2

    Hi,

    Did you rebuild your application after you have rebuilt Qt ? If not, then it's normal that nothing changed when debugging your application.

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

    K 1 Reply Last reply
    0
    • SGaistS SGaist

      Hi,

      Did you rebuild your application after you have rebuilt Qt ? If not, then it's normal that nothing changed when debugging your application.

      K Offline
      K Offline
      Kattia
      wrote on last edited by
      #3

      @SGaist Yes, i do, i also tried deleting everything on x64 folder.
      When debugging the edited file on VS i can see the edited code but the debugger ignore it like if the file were outdated.

      SGaistS 1 Reply Last reply
      0
      • K Kattia

        @SGaist Yes, i do, i also tried deleting everything on x64 folder.
        When debugging the edited file on VS i can see the edited code but the debugger ignore it like if the file were outdated.

        SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #4

        Can you give the exact steps you are doing ? It's not clear which file you are referring to.

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

        K 1 Reply Last reply
        0
        • SGaistS SGaist

          Can you give the exact steps you are doing ? It's not clear which file you are referring to.

          K Offline
          K Offline
          Kattia
          wrote on last edited by Kattia
          #5

          @SGaist I'm referring to any file I modify in the source it's not updated
          The steps:

          I edited:
          C:\Qt\6.6.0_static\qtbase\src\plugins\platforms\windows\qwindowscontext.cpp

          • run: x64 Native Tools Command Prompt for VS 2022 Preview
          • cd C:\Qt\6.6.0_static
          • ninja

          It then recompiles the source:

          ad1a76e2-0511-4ca2-adc2-ff7062758ad3-image.png

          I recompile my project but the modifications done in the source are not updating and the compiler is also ignoring it.

          For example, on qwindowscontext.cpp before compiling for the very first time i modified this:

          QTextStream str(&result);
          str << "Atlas";
          

          It successfully got updated.
          Now if i modify it again to anything else and recompile it, it's being ignored.

          see:
          https://i.imgur.com/FtjCAwE.gif

          The debugger is ignoring the changes, it should display "GGAtlas" when hovering return result;

          On a non-static build, the same exact steps work perfectly.

          I'm asking if I need to call anything else on the compiler console after ninja to make it update the source files.

          I don't speak English well, let me know if it's clearer now.

          C 1 Reply Last reply
          0
          • K Kattia

            @SGaist I'm referring to any file I modify in the source it's not updated
            The steps:

            I edited:
            C:\Qt\6.6.0_static\qtbase\src\plugins\platforms\windows\qwindowscontext.cpp

            • run: x64 Native Tools Command Prompt for VS 2022 Preview
            • cd C:\Qt\6.6.0_static
            • ninja

            It then recompiles the source:

            ad1a76e2-0511-4ca2-adc2-ff7062758ad3-image.png

            I recompile my project but the modifications done in the source are not updating and the compiler is also ignoring it.

            For example, on qwindowscontext.cpp before compiling for the very first time i modified this:

            QTextStream str(&result);
            str << "Atlas";
            

            It successfully got updated.
            Now if i modify it again to anything else and recompile it, it's being ignored.

            see:
            https://i.imgur.com/FtjCAwE.gif

            The debugger is ignoring the changes, it should display "GGAtlas" when hovering return result;

            On a non-static build, the same exact steps work perfectly.

            I'm asking if I need to call anything else on the compiler console after ninja to make it update the source files.

            I don't speak English well, let me know if it's clearer now.

            C Offline
            C Offline
            ChrisW67
            wrote on last edited by
            #6

            @Kattia

            I recompile my project but the modifications done in the source are not updating and the compiler is also ignoring it.

            You keep referring to "the source" as if it is part of your project. You are modifying the Qt library source (for an unspecified reason) and rebuilding a static library from that. Other projects can be linked against this library.

            Unless you have taken unusual steps, your project will not have dependency information related to the underlying libraries. Underlying libraries can change all you like but, unless your project's source code changes, there is nothing for ninja/make to do: so it does nothing. Since use portions of static libraries are linked into your project's executable, if this is not rebuilt, then the executable does not change and still contains whatever library it linked last time.

            When you do the equivalent with a dynamically loaded version of the same Qt libraries it will work. This is because linking is done at run time: so your project executable does not have to change to link the changed dynamic library.

            K 1 Reply Last reply
            1
            • C ChrisW67

              @Kattia

              I recompile my project but the modifications done in the source are not updating and the compiler is also ignoring it.

              You keep referring to "the source" as if it is part of your project. You are modifying the Qt library source (for an unspecified reason) and rebuilding a static library from that. Other projects can be linked against this library.

              Unless you have taken unusual steps, your project will not have dependency information related to the underlying libraries. Underlying libraries can change all you like but, unless your project's source code changes, there is nothing for ninja/make to do: so it does nothing. Since use portions of static libraries are linked into your project's executable, if this is not rebuilt, then the executable does not change and still contains whatever library it linked last time.

              When you do the equivalent with a dynamically loaded version of the same Qt libraries it will work. This is because linking is done at run time: so your project executable does not have to change to link the changed dynamic library.

              K Offline
              K Offline
              Kattia
              wrote on last edited by
              #7

              @ChrisW67 said in Edited source didnt get recognized:

              You are modifying the Qt library source (for an unspecified reason)

              Yes, im modifying the app class name among other things.

              there is nothing for ninja/make to do: so it does nothing

              But ninja is recognizing the modifications as seen in the picture I attached, it recompiles.

              so your project executable does not have to change to link the changed dynamic library.

              I also tried creating a new project it still didn't recognize the changes.

              Christian EhrlicherC C 2 Replies Last reply
              0
              • K Kattia

                @ChrisW67 said in Edited source didnt get recognized:

                You are modifying the Qt library source (for an unspecified reason)

                Yes, im modifying the app class name among other things.

                there is nothing for ninja/make to do: so it does nothing

                But ninja is recognizing the modifications as seen in the picture I attached, it recompiles.

                so your project executable does not have to change to link the changed dynamic library.

                I also tried creating a new project it still didn't recognize the changes.

                Christian EhrlicherC Offline
                Christian EhrlicherC Offline
                Christian Ehrlicher
                Lifetime Qt Champion
                wrote on last edited by
                #8

                @Kattia You don't install the newly compiled binaries. Ninja only compiles. Simply use the cmake commands as you did initially.

                Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                Visit the Qt Academy at https://academy.qt.io/catalog

                K 1 Reply Last reply
                1
                • Christian EhrlicherC Christian Ehrlicher

                  @Kattia You don't install the newly compiled binaries. Ninja only compiles. Simply use the cmake commands as you did initially.

                  K Offline
                  K Offline
                  Kattia
                  wrote on last edited by Kattia
                  #9

                  @Christian-Ehrlicher
                  All these three? or just the last two?

                  cmake --build . --parallel
                  cmake --install .
                  cmake --install . --config Debug
                  

                  Why do i need to call these cmake commands again?

                  On non-static i don't need to do this, whenever I edit the Qt library source and call ninja, and then recompile my project the changes already get recognized.

                  Christian EhrlicherC 1 Reply Last reply
                  0
                  • K Kattia

                    @Christian-Ehrlicher
                    All these three? or just the last two?

                    cmake --build . --parallel
                    cmake --install .
                    cmake --install . --config Debug
                    

                    Why do i need to call these cmake commands again?

                    On non-static i don't need to do this, whenever I edit the Qt library source and call ninja, and then recompile my project the changes already get recognized.

                    Christian EhrlicherC Offline
                    Christian EhrlicherC Offline
                    Christian Ehrlicher
                    Lifetime Qt Champion
                    wrote on last edited by Christian Ehrlicher
                    #10

                    @Kattia said in Edited source didnt get recognized:

                    On non-static i don't need to do this,

                    You have to do it there to except you modified your PATH to directly point to the Qt dlls- folder in some way.

                    /edit: I now see that you install into the build directory for unknown reason... so install is not needed. But since an external library changed you have to force a re-link to this library by e.g. modifiying something in your own code.

                    Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                    Visit the Qt Academy at https://academy.qt.io/catalog

                    1 Reply Last reply
                    2
                    • K Kattia

                      @ChrisW67 said in Edited source didnt get recognized:

                      You are modifying the Qt library source (for an unspecified reason)

                      Yes, im modifying the app class name among other things.

                      there is nothing for ninja/make to do: so it does nothing

                      But ninja is recognizing the modifications as seen in the picture I attached, it recompiles.

                      so your project executable does not have to change to link the changed dynamic library.

                      I also tried creating a new project it still didn't recognize the changes.

                      C Offline
                      C Offline
                      ChrisW67
                      wrote on last edited by
                      #11

                      @Kattia said in Edited source didnt get recognized:

                      @ChrisW67 said in Edited source didnt get recognized:

                      You are modifying the Qt library source (for an unspecified reason)

                      Yes, im modifying the app class name among other things.

                      This makes no sense. Your application code is not the Qt library source code. If you were modifying your application's source then running ninja/make over your source project would recompile it. Modifying your application source has nothing to do with Qt's library source code.

                      1 Reply Last reply
                      0
                      • K Offline
                        K Offline
                        Kattia
                        wrote on last edited by Kattia
                        #12

                        @Christian-Ehrlicher said in Edited source didnt get recognized:

                        /edit: I now see that you install into the build directory for unknown reason... so install is not needed

                        I installed into the build directory exactly to avoid calling --install . again whenever i modify anything in the source, and it does work this way when im editing/compiling on a non-static build.

                        I dont understand why this isnt working for a static build
                        I tested calling cmake --install . cmake --install . --config Debug after ninja, now the modifications got recognized but this is a waste of time waiting till it very every dll to copy just or another thing.

                        SGaistS 1 Reply Last reply
                        0
                        • K Kattia

                          @Christian-Ehrlicher said in Edited source didnt get recognized:

                          /edit: I now see that you install into the build directory for unknown reason... so install is not needed

                          I installed into the build directory exactly to avoid calling --install . again whenever i modify anything in the source, and it does work this way when im editing/compiling on a non-static build.

                          I dont understand why this isnt working for a static build
                          I tested calling cmake --install . cmake --install . --config Debug after ninja, now the modifications got recognized but this is a waste of time waiting till it very every dll to copy just or another thing.

                          SGaistS Offline
                          SGaistS Offline
                          SGaist
                          Lifetime Qt Champion
                          wrote on last edited by
                          #13

                          @Kattia that's why you don't do testing/debugging with static builds of large frameworks.

                          Any change you make on it requires that you rebuild your application as well which is also time wasting beside requiring a large amount of space on your machine.

                          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

                          • Login

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