Unsolved Statically compiled image resources
-
Hi, good cousin. During the static compilation test, I found that there are many image resources embedded in the .exe that are not used in the project. What is the situation?
Is there any way to prevent him from embedding image resources that are not used by the project?
Link: https://pan.baidu.com/s/1UiulA5_O1FYdbifa3CFk5g
Extraction code: 0000 -
@Nan-Feng said in Statically compiled image resources:
Is there any way to prevent him from embedding image resources that are not used by the project?
Don't add them to the resource files.
-
But in fact, I didn’t add the pictures in the screenshot to the resource file
My .qrc is as follows:
Link: https://pan.baidu.com/s/1JYnCRXMH7snabboxnBwkDA
Extraction code: 0000 -
@Nan-Feng said in Statically compiled image resources:
I didn’t add the pictures in the screenshot to the resource file
You did, otherwise you would not see them there.
My .qrc is as follows:
a qrc file is an ascii file, don't post screenshots...
-
The content of the .qrc file is as follows: there are all pictures used in my project, and there are no unused pictures in the screenshots. Is it static compilation? I don’t know if I need those pictures, but the compiler is a little cautious, so give me Is the compilation coming in?
<RCC>
<qresource prefix="/">
<file>images/complete_left.png</file>
<file>images/welcome_left.png</file>
<file>images/title_ico.png</file>
<file>images/close_light.png</file>
<file>images/instdir_left.png</file>
<file>images/warn.png</file>
<file>images/abort_left.png</file>
<file>images/license_left.png</file>
<file>images/uncheckBox.png</file>
<file>images/uncheckBoxHover.png</file>
<file>images/checked.png</file>
<file>images/checkedHover.png</file>
<file>images/installing_left.png</file>
<file>pluginFiles/Depth Of Field Generator PRO.AEX</file>
<file>images/readyinst_left.png</file>
<file>images/langdialog_left.png</file>
</qresource>
</RCC> -
I still don't understand your problem. Also don't know what the first image shows. The only way to iterate over the files in embedded via qrc files is to use QDir/QDirIterator and not any external program.
-
What I mean is that some image resources that are not used in my project have also been compiled. How can I prevent him from compiling unused image resources? The picture resources I mentioned are not in the qrc file. It is the display picture in the screenshot below. These pictures are obtained by extracting the compiled .exe file.
Link: https://pan.baidu.com/s/1fRXGTzFn2BxZ0Aptpoy1Sg
Extraction code: 0000 -
They don't come from your qrc file but from another one (e.g. Qt libs / plugins). You can not remove them and the linker also can't remove them since you and the linker don't know if they're used or not.