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 ):
Enable Incremental Linking NO
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
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.
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).
I had this issue, in my case the reason was installing Visual Studio 2012 on a machine which already had Visual Studion 2010. I also could not run C++ projects in both Visual Studios (Same error). There are three solutions:
Have a nice coding!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With