1

I'm trying to build Qt using nmake. But when I try this I get the below linking error.

LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt

As far as I know this is due to the .NET framework version (I'm using .NET 4.5) and I get the same linking error when I'm compiling c++ projects in VS2010. To get rid of it, I disable incremental linking as suggested in this post.

But I don't know how to do it when I'm running nmake from the VS command line. Do I have to mention it while configuring or can i pass it as a parameter to nmake ?

Community
  • 1
  • 1
Optimus
  • 405
  • 4
  • 19
  • Optimus, why did you not select an answer yet? What is left to be resolved? – lpapp Jan 08 '14 at 06:15
  • I'm really sorry @LaszloPapp , I got bit busy with some other project. I'm new to using nmake and qmake. So I don't understand what you have mentioned straight away. I'll look into this soon. – Optimus Jan 08 '14 at 15:32
  • Optimus, have you resolved it? – lpapp Jan 13 '14 at 17:53
  • Yes. I installed .NET 4.0 and now it works... I'm sorry that I couldn't follow your steps. – Optimus Jan 14 '14 at 03:09

2 Answers2

1

This is a linker flag, so you would need to pass it to your linker rather than "nmake". That is, in your Windows makefile when building from command line, you will need to find the linker invokation and pass the argument in there. Pseudo code follows:

foo: $(LD_COMMAND) /INCREMENTAL:NO

What you could is open up a qmake project file and write this:

QMAKE_LFLAGS_RELEASE = /INCREMENTAL:NO

Then, you could invoke the qmake command, and see the Makefile generated. Look for "/INCREMENT:NO" then, and the same way, you would need to put it into your Makefile if you create it in a different way.

Otherwise, it will just work if you qmake for the Makefile generation, provided you are picking up the appropriate spec file for your toolchain and environment.

lpapp
  • 48,739
  • 39
  • 106
  • 133
0

According to mkspecs/win32-msvc2010/qmake.conf of both Qt 4 and 5 QMAKE_LFLAGS_RELEASE = /INCREMENTAL:NO is already there. So you are facing some other problem in case you are compiling Qt in release mode.

Dmitry Markin
  • 1,125
  • 8
  • 8