PDA

View Full Version : QTCreator is using wrong version of nmake



mrknight
21st May 2010, 01:45
I have numerous versions of Visual Studio installed on my PC, but have configured QT to use win32-msvc2008. However, when I use QTCreator, it uses the corect settings for QMAKE, but then tries to compile and link using the wrong version of NMAKE (ie '...Microsoft Visual Studio 8/VC/BIN/nmake.exe' instead of '...Microsoft Visual Studio 9.0/VC/BIN/nmake.exe').

How can I configure the QTCreator to use the correct version? I have already tried setting the VSINSTALLDIR, VCINSTALLDIR and PATH variables to the correct folder. I have also tried to run qtcreator.exe from the VS2008 CMD prompt. Still no luck; although, I can build the application using NMAKE from the VS2008 CMD prompt. Any advise appreciated, it's got me stumped.

I have installed both 'qt-sdk-win-opensource-2010.02.1.exe' and 'qt-win-opensource-4.6.2-vs2008.exe' and have reconfigured both using the 'configure -platform win32-msvc2008' option when they did not work. Here is the error from QTCreator (with a sample app called blah, a form with a button).

Running build steps for project blah...
Starting: c:/qt/4.6.2/bin/qmake.exe C:/Qt/Projects/blah/blah.pro -spec win32-msvc2008 -r
Exited with code 0.
Starting: C:/Program Files/Microsoft Visual Studio 8/VC/BIN/nmake.exe
"C:\Program Files\Microsoft Visual Studio 8\VC\BIN\nmake.exe" -f Makefile.Debug
c:\Qt\4.6.2\bin\uic.exe mainwindow.ui -o ui_mainwindow.h
C:\Qt\4.6.2\bin\moc.exe -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -I"..\..\4.6.2\include\QtCore" -I"..\..\4.6.2\include\QtGui" -I"..\..\4.6.2\include" -I"..\..\4.6.2\include\ActiveQt" -I"debug" -I"." -I"..\..\4.6.2\mkspecs\win32-msvc2008" -D_MSC_VER=1500 -DWIN32 mainwindow.h -o debug\moc_mainwindow.cpp
Microsoft (R) Program Maintenance Utility Version 8.00.50727.762
Copyright (C) Microsoft Corporation. All rights reserved.
Microsoft (R) Program Maintenance Utility Version 8.00.50727.762
Copyright (C) Microsoft Corporation. All rights reserved.
cl -c -nologo -Zm200 -Zc:wchar_t- -Zi -MDd -GR -EHsc -W3 -w34100 -w34189 -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -I"..\..\4.6.2\include\QtCore" -I"..\..\4.6.2\include\QtGui" -I"..\..\4.6.2\include" -I"..\..\4.6.2\include\ActiveQt" -I"debug" -I"." -I"..\..\4.6.2\mkspecs\win32-msvc2008" -Fodebug\ @C:\DOCUME~1\mknight\LOCALS~1\Temp\nm57.tmp
main.cpp
mainwindow.cpp
Generating Code...
cl -c -nologo -Zm200 -Zc:wchar_t- -Zi -MDd -GR -EHsc -W3 -w34100 -w34189 -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -I"..\..\4.6.2\include\QtCore" -I"..\..\4.6.2\include\QtGui" -I"..\..\4.6.2\include" -I"..\..\4.6.2\include\ActiveQt" -I"debug" -I"." -I"..\..\4.6.2\mkspecs\win32-msvc2008" -Fodebug\ @C:\DOCUME~1\mknight\LOCALS~1\Temp\nm58.tmp
moc_mainwindow.cpp
link /LIBPATH:"c:\Qt\4.6.2\lib" /NOLOGO /DEBUG /MANIFEST /MANIFESTFILE:"debug\blah.intermediate.manifest" /SUBSYSTEM:WINDOWS "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" /OUT:debug\blah.exe @C:\DOCUME~1\mknight\LOCALS~1\Temp\nm59.tmp
qtmaind.lib(qtmain_win.obj) : fatal error LNK1103: debugging information corrupt; recompile module
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 8\VC\BIN\link.EXE"' : return code '0x44f'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 8\VC\BIN\nmake.exe"' : return code '0x2'
Stop.
Exited with code 2.
Error while building project blah
When executing build step 'Make'

mrknight
21st May 2010, 03:19
I found the problem, it existed between the keyboard and the chair. After trolling through the help file, I found a reference to setting the version of visual studio in Tools-->Options-->QT4-->QT4 Versions-->MSVC Version = 9.0. Fairly simple when you know where to look; unfortunately, I didn't!:p