Application icon broken using Q7B VS compiler on Win

Please report bugs.

Application icon broken using Q7B VS compiler on Win

Postby blatman » Wed Nov 14, 2012 10:42 am

Using the Q7B Deploy mode if the VS compiler is used the app .exe will not be linked with an icon - using the Ming compiler is OK.
Workround:
If QtCreator is used on the app .pro file generated by the Q7B Deploy process the .exe icon will be linked OK.

The only real clue I can see is in the Makefile.release files as below -
Q7B generated Makefile.release
LINK = link
LFLAGS = /LIBPATH:"c:\QtSDK\Desktop\Qt\4.8.1\msvc2008\lib" /NOLOGO /DYNAMICBASE /NXCOMPAT /INCREMENTAL:NO /MANIFEST /MANIFESTFILE:"release\VSIconBug.intermediate.manifest" /SUBSYSTEM:WINDOWS "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'"
LIBS = C:\Basic4Qt\Qt\4.8.0\lib\qtmain.lib C:\Basic4Qt\Qt\4.8.0\lib\QtDeclarative4.lib C:\Basic4Qt\Qt\4.8.0\lib\QtWebKit4.lib C:\Basic4Qt\Qt\4.8.0\lib\phonon4.lib C:\Basic4Qt\Qt\4.8.0\lib\QtSvg4.lib C:\Basic4Qt\Qt\4.8.0\lib\QtSql4.lib C:\Basic4Qt\Qt\4.8.0\lib\QtXml4.lib C:\Basic4Qt\Qt\4.8.0\lib\QtGui4.lib C:\Basic4Qt\Qt\4.8.0\lib\QtNetwork4.lib C:\Basic4Qt\Qt\4.8.0\lib\QtCore4.lib C:\Basic4Qt\Qt\4.8.0\lib\QtUiTools.lib
QMAKE = c:\QtSDK\Desktop\Qt\4.8.1\msvc2008\bin\qmake
IDC = c:\QtSDK\Desktop\Qt\4.8.1\msvc2008\bin\idc.exe

QtCreator generated Makefile.release
LINK = link
LFLAGS = /LIBPATH:"c:\QtSDK\Desktop\Qt\4.8.1\msvc2008\lib" /NOLOGO /DYNAMICBASE /NXCOMPAT /INCREMENTAL:NO /MANIFEST /MANIFESTFILE:"release\VSIconBug.intermediate.manifest" /SUBSYSTEM:WINDOWS "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'"
LIBS = c:\QtSDK\Desktop\Qt\4.8.1\msvc2008\lib\qtmain.lib c:\QtSDK\Desktop\Qt\4.8.1\msvc2008\lib\QtDeclarative4.lib c:\QtSDK\Desktop\Qt\4.8.1\msvc2008\lib\QtWebKit4.lib c:\QtSDK\Desktop\Qt\4.8.1\msvc2008\lib\phonon4.lib c:\QtSDK\Desktop\Qt\4.8.1\msvc2008\lib\QtSvg4.lib c:\QtSDK\Desktop\Qt\4.8.1\msvc2008\lib\QtSql4.lib c:\QtSDK\Desktop\Qt\4.8.1\msvc2008\lib\QtXml4.lib c:\QtSDK\Desktop\Qt\4.8.1\msvc2008\lib\QtGui4.lib c:\QtSDK\Desktop\Qt\4.8.1\msvc2008\lib\QtNetwork4.lib c:\QtSDK\Desktop\Qt\4.8.1\msvc2008\lib\QtCore4.lib c:\QtSDK\Desktop\Qt\4.8.1\msvc2008\lib\QtUiTools.lib release\windows_application_icon.res C:\QtSDK\Desktop\Qt\4.8.1\msvc2008\lib\QtXml4.lib C:\QtSDK\Desktop\Qt\4.8.1\msvc2008\lib\QtGui4.lib C:\QtSDK\Desktop\Qt\4.8.1\msvc2008\lib\QtCore4.lib
QMAKE = c:\qtsdk\desktop\qt\4.8.1\msvc2008\bin\qmake.exe
IDC = c:\QtSDK\Desktop\Qt\4.8.1\msvc2008\bin\idc.exe

In the Q7B file the LIBS entry is the apparent difference and does not contain 'release\windows_application_icon.res' as an argument for QtUiTools.lib reference - the same qmake file is being used but I suspect that qmake is using a hardcoded? reference somewhere.

To test this far I tweaked the Registry to try and get some commonality with the QtCreator environment -

QtDir C:/Basic4Qt/Qt/4.8.0 original as installed
C:/QtSDK/Desktop/Qt/4.8.1/msvc2008 test setting

Anyway, that is as far as I can get - I'll climb back up to the Basic level now ...

Cheers,
B
blatman
 
Posts: 51
Joined: Mon Jul 16, 2012 12:33 pm
Location: UK

Re: Application icon broken using Q7B VS compiler on Win

Postby berndnoetscher » Wed Nov 14, 2012 2:30 pm

Thanks for the investigation :-)
berndnoetscher
Site Admin
 
Posts: 344
Joined: Thu Mar 25, 2010 9:57 am

Re: Application icon broken using Q7B VS compiler on Win

Postby blatman » Fri Mar 21, 2014 10:19 am

Well, decided to play around a bit with compiling the Q7B source and managed to fix this.

Compiled Q7Basic for Qt 4.8.5 on Vbox 4.3.6 on Mavericks and the following tweaks appear to fix the issue of no icon on the exe.

_Q7BCompiler.cpp has hard coded paths for the LIBs at about line 1415

Line 1416 QString ss = " $$$$/Qt/4.8.0/lib/qtmaind.lib $$$$/Qt/4.8.0/lib/QtDeclaratived4.lib $$$$/Qt/4.8.0/lib/QtWebKitd4.lib $$$$/Qt/4.8.0/lib/phonond4.lib $$$$/Qt/4.8.0/lib/QtSvgd4.lib $$$$/Qt/4.8.0/lib/QtSqld4.lib $$$$/Qt/4.8.0/lib/QtXmld4.lib $$$$/Qt/4.8.0/lib/QtGuid4.lib $$$$/Qt/4.8.0/lib/QtNetworkd4.lib $$$$/Qt/4.8.0/lib/QtCored4.lib $$$$/Qt/4.8.0/lib/QtUiToolsd.lib";

Line 1419 QString ss2 = " $$$$/Qt/4.8.0/lib/qtmain.lib $$$$/Qt/4.8.0/lib/QtDeclarative4.lib $$$$/Qt/4.8.0/lib/QtWebKit4.lib $$$$/Qt/4.8.0/lib/phonon4.lib $$$$/Qt/4.8.0/lib/QtSvg4.lib $$$$/Qt/4.8.0/lib/QtSql4.lib $$$$/Qt/4.8.0/lib/QtXml4.lib $$$$/Qt/4.8.0/lib/QtGui4.lib $$$$/Qt/4.8.0/lib/QtNetwork4.lib $$$$/Qt/4.8.0/lib/QtCore4.lib $$$$/Qt/4.8.0/lib/QtUiTools.lib";
changed to -
Line 1416 QString ss = " $$$$/Qt/4.8.5/lib/qtmaind.lib $$$$/Qt/4.8.5/lib/QtDeclaratived4.lib $$$$/Qt/4.8.5/lib/QtWebKitd4.lib $$$$/Qt/4.8.5/lib/phonond4.lib $$$$/Qt/4.8.5/lib/QtSvgd4.lib $$$$/Qt/4.8.5/lib/QtSqld4.lib $$$$/Qt/4.8.5/lib/QtXmld4.lib $$$$/Qt/4.8.5/lib/QtGuid4.lib $$$$/Qt/4.8.5/lib/QtNetworkd4.lib $$$$/Qt/4.8.5/lib/QtCored4.lib $$$$/Qt/4.8.5/lib/QtUiToolsd.lib debug/windows_application_icon.res";

Line 1419 QString ss2 = " $$$$/Qt/4.8.5/lib/qtmain.lib $$$$/Qt/4.8.5/lib/QtDeclarative4.lib $$$$/Qt/4.8.5/lib/QtWebKit4.lib $$$$/Qt/4.8.5/lib/phonon4.lib $$$$/Qt/4.8.5/lib/QtSvg4.lib $$$$/Qt/4.8.5/lib/QtSql4.lib $$$$/Qt/4.8.5/lib/QtXml4.lib $$$$/Qt/4.8.5/lib/QtGui4.lib $$$$/Qt/4.8.5/lib/QtNetwork4.lib $$$$/Qt/4.8.5/lib/QtCore4.lib $$$$/Qt/4.8.5/lib/QtUiTools.lib release/windows_application_icon.res";


Also did -

#RC_FILE+=./Resources/windows_application_icon.rc => RC_FILE+=./Resources/windows_application_icon.rc - uncommented to allow exe icon

In _Q7BCompiler.cpp at about Line 1227 -

sRC_FILE = "RC_FILE+=Resources/windows_application_icon.rc\n"; ('../' removed)

Seems to work fine with the .exe having the appropriate icon in Debug and Deploy(release) mode. (Of course the icon needs to be in the Resource folder for building.

There is probably a better way to fix this using alias' rather than hardcoding but it'll do for me just now.

Cheers.
blatman
 
Posts: 51
Joined: Mon Jul 16, 2012 12:33 pm
Location: UK


Return to Bug Reports

Who is online

Users browsing this forum: No registered users and 0 guests