Why does the size of the file grow so much with each release without changing the code?
-
@duncan98
so you clean the folder and rebuild
If you do it again, this time the exe size is bigger ? -
Then its a bit odd as a clean build should be same size unless you add something new.
-
@duncan98 I am certain it has nothing to do with Qt Creator. Starting Qt Creator will not change an executable. Creator is not a C++ compiler; it is an editor that can launch a make process to build your executable for you. The compiler and linker are what produce the executable. In your case, this a GCC version. Producing the executable is not connected to running the executable.
The ways a Windows executable file can grow is:
- You put more code, or embedded resources, in it.
- You build a version with debug symbols, which will be a bit larger (but not usually an order of magnitude)
- You build a version with different compiler optimisation options.
- You change the compiler; different compilers will produce different sized results.
- Some external process, that is neither the compiler nor the running executable, opens the file and appends to the executable.
If you want to support your claimed behaviour with some evidence:
- Delete your build folder
- Verify that your target executable (wms.exe) does not exist.
- Build your application
- Post the entire content of the Qt Creator compiler output panel (copy and paste the text not a partial screen shot)
- Execute "dir wms.exe" in the build folder and post the result
- Delete the executable
- Build your application
- Post the entire content of the Qt Creator compiler output panel (copy and paste the text not a partial screen shot). Note that this should not include calls to compile C++ source, only a linker call.
- Execute "dir wms.exe" in the build folder and post the result
-
@duncan98 I am certain it has nothing to do with Qt Creator. Starting Qt Creator will not change an executable. Creator is not a C++ compiler; it is an editor that can launch a make process to build your executable for you. The compiler and linker are what produce the executable. In your case, this a GCC version. Producing the executable is not connected to running the executable.
The ways a Windows executable file can grow is:
- You put more code, or embedded resources, in it.
- You build a version with debug symbols, which will be a bit larger (but not usually an order of magnitude)
- You build a version with different compiler optimisation options.
- You change the compiler; different compilers will produce different sized results.
- Some external process, that is neither the compiler nor the running executable, opens the file and appends to the executable.
If you want to support your claimed behaviour with some evidence:
- Delete your build folder
- Verify that your target executable (wms.exe) does not exist.
- Build your application
- Post the entire content of the Qt Creator compiler output panel (copy and paste the text not a partial screen shot)
- Execute "dir wms.exe" in the build folder and post the result
- Delete the executable
- Build your application
- Post the entire content of the Qt Creator compiler output panel (copy and paste the text not a partial screen shot). Note that this should not include calls to compile C++ source, only a linker call.
- Execute "dir wms.exe" in the build folder and post the result
-
@ChrisW67
Thank you for your explanation. It should be related to the compiler. But something more strange happened. I uninstalled and reinstalled QT, and now I can't start it 😂 -
@duncan98 I am certain it has nothing to do with Qt Creator. Starting Qt Creator will not change an executable. Creator is not a C++ compiler; it is an editor that can launch a make process to build your executable for you. The compiler and linker are what produce the executable. In your case, this a GCC version. Producing the executable is not connected to running the executable.
The ways a Windows executable file can grow is:
- You put more code, or embedded resources, in it.
- You build a version with debug symbols, which will be a bit larger (but not usually an order of magnitude)
- You build a version with different compiler optimisation options.
- You change the compiler; different compilers will produce different sized results.
- Some external process, that is neither the compiler nor the running executable, opens the file and appends to the executable.
If you want to support your claimed behaviour with some evidence:
- Delete your build folder
- Verify that your target executable (wms.exe) does not exist.
- Build your application
- Post the entire content of the Qt Creator compiler output panel (copy and paste the text not a partial screen shot)
- Execute "dir wms.exe" in the build folder and post the result
- Delete the executable
- Build your application
- Post the entire content of the Qt Creator compiler output panel (copy and paste the text not a partial screen shot). Note that this should not include calls to compile C++ source, only a linker call.
- Execute "dir wms.exe" in the build folder and post the result
-
@duncan98
Here is the very first call to a C++ compiler in your output:g++ -c -fno-keep-inline-dllexport -O2 -g -std=gnu++11 ...
The option -g tells, "GCC to emit extra information for use by a debugger"
https://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html#Debugging-OptionsSo, while you think you are generating a release build, g++ is embedding debugging information.
I am not sure if the bundled MingW ships a strip.exe, but if it does, run it against a copy of mysoft.exe and look at the resulting size.
Now the question is, how did that '-g' option get there. This is consistent with a normal debug build.
This could be a deliberate action in your project, a stale Makefile, broken Project configuration in Qt Creator.You need to check:
- The project configuration in Qt Creator to ensure you have a sane setup. You could delete the Qt Creator *.user file and import the project fresh.
- Your PRO file or CMakeLists.txt for manipulations of the CFLAGS/CXXFLAGS.
- Absolutely rerun qmake/cmake to regenerate your Makefile (delete it first to ensure it is generating the file you think).
You could build the project from clean source outside QtCreator to eliminate that as any cause.
-
@duncan98
Here is the very first call to a C++ compiler in your output:g++ -c -fno-keep-inline-dllexport -O2 -g -std=gnu++11 ...
The option -g tells, "GCC to emit extra information for use by a debugger"
https://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html#Debugging-OptionsSo, while you think you are generating a release build, g++ is embedding debugging information.
I am not sure if the bundled MingW ships a strip.exe, but if it does, run it against a copy of mysoft.exe and look at the resulting size.
Now the question is, how did that '-g' option get there. This is consistent with a normal debug build.
This could be a deliberate action in your project, a stale Makefile, broken Project configuration in Qt Creator.You need to check:
- The project configuration in Qt Creator to ensure you have a sane setup. You could delete the Qt Creator *.user file and import the project fresh.
- Your PRO file or CMakeLists.txt for manipulations of the CFLAGS/CXXFLAGS.
- Absolutely rerun qmake/cmake to regenerate your Makefile (delete it first to ensure it is generating the file you think).
You could build the project from clean source outside QtCreator to eliminate that as any cause.
-
@ChrisW67
I feel that creator has some obvious non-human bugs, such as making a makefile error for no reason, and the size of the released file is too large -
@duncan98 Do you actually want to solve the problem? Constantly asserting your feelings that Qt Creator is at fault is not helping anyone.
Did you actually do any of the things I suggested?