6

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 ):

  1. Compile with Enable Incremental Linking NO
  2. 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

  1. 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
  2. Do I need to update Qt?
  3. 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

Project compile settings

-- Edit ---

I crosschecked, the paths are still to VS2010 and there is no .net 4.5 path included.

Paths

-- 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).

Build configs

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.

Community
  • 1
  • 1
Horst Walter
  • 13,663
  • 32
  • 126
  • 228
  • 1
    There are a couple of feedback articles about it at connect.microsoft.com. But so far without Microsoft being able to repro it. You could post your own, albeit that this would also heavily veer towards no-repro given the unusual build environment. High odds for environmental issues, anti-malware first. Or just plain what it says, a corrupted .obj or .lib file. – Hans Passant Jan 03 '13 at 14:54
  • 3
    This helped me http://stackoverflow.com/a/14144713/78043 – ba__friend Jan 11 '13 at 20:55
  • Thanks a lot for pointing me there! – Horst Walter Jan 13 '13 at 09:22

2 Answers2

3

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).

Community
  • 1
  • 1
Horst Walter
  • 13,663
  • 32
  • 126
  • 228
1

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:

  1. Temporary solution : Use Release mod instead of Debug, Application runs, but no debugging is available.
  2. Download and install Qt MinGW instead of VS version (Twice in size)
  3. (Recommended) Install/Reinstall SP1 of Visual Studio 2010.

Have a nice coding!

Behzad
  • 31
  • 3