0

我已安装:Visual Studio 2010。qt-windows-opensource-5.1.0-msvc2010-x86-offline 和 qt-vs-addin-1.2.2-opensource

一切正常,我能够使用 qt creator 创建应用程序并编译和运行它。

但我已经从环境变量修改了原始路径:http: //img850.imageshack.us/img850/382/nh4e.png

现在,当尝试使用 qt creator 运行应用程序时,我收到了这个错误:

'cl' is not recognized as an internal or external command,
operable program or batch file.
jom: C:\C++\Qt\build-tesst-Desktop_Qt_5_1_0_MSVC2010_32bit-Debug\Makefile.Debug [debug\mainwindow.obj] Error 1
jom: C:\C++\Qt\build-tesst-Desktop_Qt_5_1_0_MSVC2010_32bit-Debug\Makefile [debug] Error 2
20:54:01: The process "C:\Qt\Qt5.1.0\Tools\QtCreator\bin\jom.exe" exited with code 2.
Error while building/deploying project tesst (kit: Desktop Qt 5.1.0 MSVC2010 32bit)
When executing step 'Make'

我已经在互联网上阅读了几十个线程但没有,我已经重新安装了 qt-windows-opensource-5.1.0-msvc2010-x86-offline 和 qt-vs-addin-1.2.2-opensource

但仍然是同样的错误。

稍后编辑:程序不会仅从 qt creator 运行。如果我在 Visual Studio 2010 上导入 qt 项目,它可以编译和运行应用程序。

4

1 回答 1

0

当您从环境修改原始路径变量时,QtCreator toolchange 的自动检测可能无法检测到编译器(您的案例 VS 编译器)。因此,要解决此问题,您需要正确更新路径变量或手动将 vs 编译器添加到工具通道和构建中。您也可以尝试使用 MinGw 编译器。

于 2013-08-16T19:38:55.040 回答