9

I just downloaded Qt SDK 4.8.1 and, after installing it, I simply tried to compile a default C++ project, but I got this strange error.

16:50:24: Running build steps for project test...
16:50:24: Configuration unchanged, skipping qmake step.
16:50:24: Starting: "C:\QtSDK\QtCreator\bin\jom.exe"
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_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -I"........\QtSDK\Desktop\Qt\4.8.1\msvc2008\include\QtCore" -I"........\QtSDK\Desktop\Qt\4.8.1\msvc2008\include\QtGui" -I"........\QtSDK\Desktop\Qt\4.8.1\msvc2008\include" -I"........\QtSDK\Desktop\Qt\4.8.1\msvc2008\include\ActiveQt" -I"debug" -I"." -I"..\test" -I"." -I"........\QtSDK\Desktop\Qt\4.8.1\msvc2008\mkspecs\win32-msvc2008" -Fodebug\ @C:\DOCUME~1\dfuser\IMPOST~1\Temp\main.obj.1464.0.jom
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_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -I"........\QtSDK\Desktop\Qt\4.8.1\msvc2008\include\QtCore" -I"........\QtSDK\Desktop\Qt\4.8.1\msvc2008\include\QtGui" -I"........\QtSDK\Desktop\Qt\4.8.1\msvc2008\include" -I"........\QtSDK\Desktop\Qt\4.8.1\msvc2008\include\ActiveQt" -I"debug" -I"." -I"..\test" -I"." -I"........\QtSDK\Desktop\Qt\4.8.1\msvc2008\mkspecs\win32-msvc2008" -Fodebug\ @C:\DOCUME~1\dfuser\IMPOST~1\Temp\mainwindow.obj.1464.0.jom
C:\QtSDK\QtCreator\bin\jom.exe -f Makefile.Debug
jom: C:\Documents and Settings\dfuser\Desktop\test-build-desktop-Qt_4_8_1_for_Desktop_-MSVC2008_Qt_SDK__Debug\Makefile.Debug [debug\main.obj] Error 2

jom 1.0.8 - empower your cores

jom: C:\Documents and Settings\dfuser\Desktop\test-build-desktop-Qt_4_8_1_for_Desktop_-MSVC2008_Qt_SDK__Debug\Makefile [debug] Error 2
16:50:24: The process "C:\QtSDK\QtCreator\bin\jom.exe" exited with code 2.
Error while building project test (target: Desktop)
When executing build step 'Make'

Does anyone know what is the cause?

I don't know if it's relevant or not, but before getting this error I got the common error about cl nor found; I solved adding the path to cl in the project settings.

user1372813
  • 135
  • 1
  • 1
  • 6

6 Answers6

6

I've solved it : try to execute cl.exe directly (C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\cl) if you get a dll error, it's because your environment is not set correctly. So, you need to call vcvarsall.bat before lunch QtCreator. To do that each time, you can create a .bat file which contains the following:

C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat

{Path to QtCreator}\qtcreator

(Correct the paths if your configuration is not the same)

You will need to execute this script to get QtCreator with the right environment variables, otherwise, the dll error appears but is not reported, and you get this "Error : 2"

hl037_
  • 3,520
  • 1
  • 27
  • 58
  • Current Qt Creator should run this automatically, check Projects/Kit/Compiler options. My problem was an QMAKE_EXTRA_TARGETS entry in the .pro file (running an executable, probably a path issue, I have not investigated further yet). – handle Aug 05 '15 at 08:53
  • The error does go away when switching back to nmake in the kit options. Also see https://bugreports.qt.io/browse/QTCREATORBUG-6546 – handle Sep 02 '15 at 09:34
  • Not related to the bug: do make sure you try to run the target manually to see the cause of the error... Good luck – handle Sep 02 '15 at 10:07
2

I had somewhat similar problem in Qt 5.3

21:22:03: Running steps for project Server...
21:22:03: Configuration unchanged, skipping qmake step.
21:22:03: Starting: "C:\Qt\Qt5.3.2\Tools\mingw482_32\bin\mingw32-make.exe" 
C:\make\bin; -f Makefile.Debug
Makefile:34: recipe for target 'debug' failed
process_begin: CreateProcess(NULL, C:\make\bin; -f Makefile.Debug, ...) failed.
make (e=2): The system cannot find the file specified.

mingw32-make: *** [debug] Error 2
21:22:05: The process "C:\Qt\Qt5.3.2\Tools\mingw482_32\bin\mingw32-make.exe" exited with code 2.
Error while building/deploying project Server (kit: Desktop Qt 5.3 MinGW 32bit)
When executing step "Make"

I did the following to get rid of the error.
From the left pane of the Qt,

Projects > Build > Build Environment:

Check the Clear System environment
Kahn
  • 755
  • 3
  • 11
  • 28
1

In Linux terminal:

sudo apt-get install build-essential cmake libqt4-dev

I'm sorry I don't know why this code works but I had the same problem in Linux and I solved it this way.

Mateusz Piotrowski
  • 8,029
  • 10
  • 53
  • 79
1

I have had this issue many times and what fixed it for me was simply renaming the folder that the project was in. Alternatively you could create a new project and just copy all your header and source files into that new project.

vatsk
  • 36
  • 5
0

Okay so you can do this.

Go to Start->Choose Qt folder->minigw

When you start it you will be loaded int cmd, after that locate your project. Then you can type: qmake and after that make and then you have built project

If it doesn't work try to go trough the DOCUMENTATION to see how to use minigw when you are using Qt.

If you need anymore help let me know I'll be glad to help you.

EDIT:

One more thing. In your question problem may be connected to environmental variables. As they are not probably set to show to the make command. If you don't want to bother with minigw you can maybe check your environmental variables if they have set path: to make

user123_456
  • 5,635
  • 26
  • 84
  • 140
0

I create a new project with the same name in other folder, copy internal files except <project_name>.pro.user file.

This work form me, I don't know why, but removing <project_name>.pro.user file from my original project error continues.

Anibal Anto
  • 99
  • 1
  • 2