Search code examples
visual-studio-2010qtnmake

Building Qt for VS2010 with nmake returns link error


I'm trying to build Qt for visual studio 2010 and I'm following the instruction in the accepted answer of this post

I'm using the modified configure command:

configure.exe -release -no-webkit -no-phonon -no-phonon-backend -no-script -no-scripttools -no-qt3support -no-multimedia -qt-libpng -qt-zlib -qt-libmng -qt-libtiff -qt-libjpeg

Which works fine, but when I start the nmake it eventually fails and returns me this error:

itemviews\qabstractitemview.cpp(2311) : error C2039: 'Key_BackSpace' : is not a member of 'Qt'
itemviews\qabstractitemview.cpp(2311) : error C2065: 'Key_BackSpace' : undeclared identifier
itemviews\qabstractitemview.cpp(2311) : error C2051: case expression not constant

...

Generating Code...
NMAKE : fatal error U1077: '"c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\cl.EXE"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.

The original command I was using was the one used in the post mentionned earlier but I added these:

-qt-libpng -qt-zlib -qt-libmng -qt-libtiff -qt-libjpeg

and removed this:

-no-ltcg

for it to work properly, but the nmake still won't work.

Any help would be appreciated, thanks


Solution

  • Definitely way after the fact here, but I was able to work around this issue by commenting out the Qt::Key_BackSpace case in qabstractitemview.cpp on line 2311 for QT 4.6.4. I guess the key definition was changed in a patch or something equally goofy. You can find the file in /%My QT Directory%/src/gui/itemviews/qabstractitemview.cpp. Hope this helps!