Qt : After installation of VS2012 LNK1123 failure during conversion to COFF

c++, qt, qt-creator, visual-studio-2012

Solution

All credits to ba__friend for the hint. The reason is the wrong `cvtres.exe` as described here.Disable the old one and all is fine (at least in my particular case).

Problem

After I have installed VS2012 my Qt project does not compiler anymore (have VS2010 and VS2012 on my computer). Message: `LNK1123: failure during conversion to COFF: file invalid or corrupt` . It was fine before with VS2010 only. For the VS2012 environment it is recommended to (see SO here ): - Compile with `Enable Incremental Linking NO` - Uninstall .net 4.5 Since I am not using Qt in combination with VS2012 (so no plugIn), I cannot setup the project as mentioned. Nor can I uninstall .net 4.5 (needed for another project). Is there any chance to solve the issue? Some related questions I have - Would it be a solution to compile against VS2012 C++ compiler? Here it says I'd need an own compilation of Qt 5 for this - I would like to avoid such a hassle - Do I need to update Qt? - Or is there a way to simply set `Incremental Linking to off` as in a VS project? Where in the build settings (screenshot below) would I need to set it? Win 7, x86 QtCreator 2.5.2 Qt 4.8.1 VS2012 Ultimate with Update 1, VS2010 still installed -- Edit --- I crosschecked, the paths are still to VS2010 and there is no .net 4.5 path included. -- Edit 2 -- as of HP's comment At least I have tried with my Anti Virus Software off. Same issue. Furthermore I have checked some other smaller Qt projects (I am a sporadic Qt coder, so I do not have plenty of experience in that field). They do compile. Also all my sub projects in the affected Qt project do compile, only the last part (GUI, using all of the sub projects) fails with the above error. -- One step further -- In my `.pro` file I am using the following lines to get a `DEFINE` with the hg version, using this for ages. ``` VERSION = $$system(P:/Tools/TortoiseHg/hg parents --template '{latesttag}+{latesttagdistance}') --- $$system line seems to be the line causing the COFF issue, WHY??? DEFINES += VERSION=\\\"$$VERSION\\\" ``` Taking this out, I was able to recompile without the COFF error. But the application crashed due to some mixed 4.8.0 / 4.8.1 libs. Then I went through all sub projects and found duplicated build configurations. Sometimes I had the same entries twice, sometimes missing. Corrected them, app runs now (still without the version tag). Checked the hg comment on `CMD`, seems to be OK. ``` >P:/Tools/TortoiseHg/hg parents --template '{latesttag}+{latesttagdistance}' '0.8.902+1' ``` So why is this leading to the COFF error, and why the messed configurations?. Guess I am getting too old for this crap.

Original source

Related problems