Edited source didnt get recognized
-
I have compiled the Qt 6.6.0 source
static
as:configure.bat -static -debug-and-release -platform win32-msvc -opensource -confirm-license -force-debug-info -skip qtwebengine -prefix "C:\Qt\6.6.0_static" cmake --build . --parallel cmake --install . cmake --install . --config Debug
After modifying anything I'm calling
ninja
C:\Qt\6.6.0_static>ninja [25/25] Linking CXX executable qtbase\bin\qmleasing.exe
It detects the modifications and compiles
However, when debugging the application these modifications are ignored.
I'm using VS22, I tested selecting the
qmake.exe
located in these two folders:I have compiled another separate build using the same source and parameters on
configure.bat
removing only the-static
on this build whenever I modify anything and callninja
the modifications get recognized correctly.When it's a static build, after editing something I need to call any other parameter than
ninja
? -
Hi,
Did you rebuild your application after you have rebuilt Qt ? If not, then it's normal that nothing changed when debugging your application.
-
Hi,
Did you rebuild your application after you have rebuilt Qt ? If not, then it's normal that nothing changed when debugging your application.
-
@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.Can you give the exact steps you are doing ? It's not clear which file you are referring to.
-
Can you give the exact steps you are doing ? It's not clear which file you are referring to.
@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:
I recompile my project but the modifications done in the source are not updating and the compiler is also ignoring it.
For
example
, onqwindowscontext.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.gifThe 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.
-
@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:
I recompile my project but the modifications done in the source are not updating and the compiler is also ignoring it.
For
example
, onqwindowscontext.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.gifThe 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.
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.
-
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.
@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.
-
@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.
@Kattia You don't install the newly compiled binaries. Ninja only compiles. Simply use the cmake commands as you did initially.
-
@Kattia You don't install the newly compiled binaries. Ninja only compiles. Simply use the cmake commands as you did initially.
@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-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.@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.
-
@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.
@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.
-
@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 callingcmake --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. -
@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 callingcmake --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.@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.