Why does the size of the file grow so much with each release without changing the code?
-
@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?
-
From here it looks like you are not approaching the problem in a methodical way. Computers are deterministic beasts, same input, same process, same output. You are claiming that building the same source, with the same tool chain, gives a small executable the first time, a larger executable the second, even larger the third etc. This is plainly utterly extraordinary given that the executable is rewritten from scratch every time. With extraordinary claims you need to present extraordinary evidence.
The evidence you have presented to date is that your build is misconfigured and, despite looking like a release build is actually including a bunch of debug information. There is a reason for this that I, and others, are trying to help you find. It may be bug in the mkspecs bundled in the particular Qt library you building against (this is not Qt Creator BTW) but this is the last place to look for the fault.
Since you have done what I asked:
- Please provide the result of the second build from my earlier post and the size of the executable produced by that build (not some other one you stashed away). I expect it will be exactly the same size as the first and establish that the extraordinary claim is false.
- Tell me whether the bundled MingW contains a strip.exe and what the result of using it was? I expect the size will shrink to something more reasonable, consistent with the extra size being debug information.
- Tell us whether any part of your PRO file, or things it includes, manipulate the QMAKE_*, CFLAG or CXXFLAGS variable, and how. What is in the QT variable set to?
Tell us about the "makefile error for no reason." The output you posted earlier looks like a quite normal Makefile was processed and your code generated large numbers of warnings when compiled. Warnings are not without reason and not errors, but they may bite you later.
-
From here it looks like you are not approaching the problem in a methodical way. Computers are deterministic beasts, same input, same process, same output. You are claiming that building the same source, with the same tool chain, gives a small executable the first time, a larger executable the second, even larger the third etc. This is plainly utterly extraordinary given that the executable is rewritten from scratch every time. With extraordinary claims you need to present extraordinary evidence.
The evidence you have presented to date is that your build is misconfigured and, despite looking like a release build is actually including a bunch of debug information. There is a reason for this that I, and others, are trying to help you find. It may be bug in the mkspecs bundled in the particular Qt library you building against (this is not Qt Creator BTW) but this is the last place to look for the fault.
Since you have done what I asked:
- Please provide the result of the second build from my earlier post and the size of the executable produced by that build (not some other one you stashed away). I expect it will be exactly the same size as the first and establish that the extraordinary claim is false.
- Tell me whether the bundled MingW contains a strip.exe and what the result of using it was? I expect the size will shrink to something more reasonable, consistent with the extra size being debug information.
- Tell us whether any part of your PRO file, or things it includes, manipulate the QMAKE_*, CFLAG or CXXFLAGS variable, and how. What is in the QT variable set to?
Tell us about the "makefile error for no reason." The output you posted earlier looks like a quite normal Makefile was processed and your code generated large numbers of warnings when compiled. Warnings are not without reason and not errors, but they may bite you later.
-
@duncan98
@ChrisW67 has replied to you at length stating that it looks like the-g
option is being passed tog++
even when building for Release instead of Debug, at least some of the time from what you say. You need to find out why that is and stop it doing so. That is the answer to your question, even if you ask it repeatedly. -
@duncan98
@ChrisW67 has replied to you at length stating that it looks like the-g
option is being passed tog++
even when building for Release instead of Debug, at least some of the time from what you say. You need to find out why that is and stop it doing so. That is the answer to your question, even if you ask it repeatedly. -
@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 said in Why does the size of the file grow so much with each release without changing the code?:
@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.
-O2 -g could be a mixed build option for both release and debug. For publishing only release(-O2) is needed. On Qt creator there is option for Release only on Build settings tab.
-
@duncan98
@ChrisW67 has replied to you at length stating that it looks like the-g
option is being passed tog++
even when building for Release instead of Debug, at least some of the time from what you say. You need to find out why that is and stop it doing so. That is the answer to your question, even if you ask it repeatedly. -
@duncan98
Which problem? You have reported about 3 problems, and jump from one to another.Compile your executable without the
-g
and look at the executable size. Is it the 2MB you reported earlier? Compile with the-g
and look at the executable size. Is it the 100MB you reported earlier? Assuming this is the case, you know it is the-g
. -
@duncan98 said in Why does the size of the file grow so much with each release without changing the code?:
Are you sure this is the way to solve the problem?
Looking at the evidence, applying logic to working out what is actually happening, and then why it is happening is absolutely the way to sort the problem. Are you interested in this process?
Here are the different problems you have described (no particular order):
- You are claiming that building the same source, with the same tool chain, gives a small executable the first time, a larger executable the second, even larger the third etc. (First post)
Almost certainly not happening, and we've seen no evidence. We have seen a debug sized build come out of something like a release build
- "I uninstall qt5.15.2 and install qt5.15.1. It just works." You are not clear what "it" is. I am assuming what you mean is that building the same source against Qt 5.15.1 and Qt 5.15.2 libraries gives a reasonably sized executable and a large (debug) executable respectively.
If true, indicates that a potential problem exists in the Qt 5.15.2 library distribution (which is not Qt Creator) or something undefined/undocumented your project file does that breaks under the later version.
- Qt Creator doesn't start
If it doesn't start then surely it cannot be the cause of this problem. Seriously. Build your project outside Qt Creator and record the results. If a release build fails to generate a stable, smallish executable then the problem is absolutely not Qt Creator.
- Error in a debug build makefile while complaining about size of a claimed release build.
Someone is confused. You should be looking at the first error message, not the last (your one line screen grab).
-
Why does the size of the EXE file grow so much with each release without changing the code? The first time it was 3M, the second time it was 7M, the third time it was 10M, and the fourth time it was 100M. This is true even after a delete is rebuilt
@duncan98
I got something similar (Memory usage was increasing so immensely) along with this problem
I tried reinstalling (fully remove all things and reinstall) and it worked. it is not the answer but it can solveEDIT:
Sorry You have tried this , ButI uninstall qt5.15.2 and install qt5.15.1. It just works
I guess qt5.15.2 should have worked after re installation,
If your problem is solved,
Don't forget to mark it as solved -
@duncan98
I got something similar (Memory usage was increasing so immensely) along with this problem
I tried reinstalling (fully remove all things and reinstall) and it worked. it is not the answer but it can solveEDIT:
Sorry You have tried this , ButI uninstall qt5.15.2 and install qt5.15.1. It just works
I guess qt5.15.2 should have worked after re installation,
If your problem is solved,
Don't forget to mark it as solved@Thank-You
Hello, does what you said have anything to do with the problem?