背景:
-------
开发环境:
Qt5.9.0
两种编译环境:MINGW_32 MSVC2015
Path:
问题:
-------
在MINGW编译环境中,新建工程之后,就会显示一系列的问题,如下:
error: Variable QMAKE_DEFAULT_INCDIRS is not defined.。。
之后在执行Qmake 的时候 出现如下的错误:
15:10:40: 为项目untitled12执行步骤 ...
15:10:40: 正在启动 "C:\Qt\Qt5.9.0\5.9\mingw53_32\bin\qmake.exe" E:\text\untitled12\untitled12.pro -spec win32-g++ "CONFIG+=debug" "CONFIG+=qml_debug"
系统找不到指定的文件。
系统找不到指定的文件。
系统找不到指定的文件。
系统找不到指定的文件。
系统找不到指定的文件。
系统找不到指定的文件。
C:/Qt/Qt5.9.0/5.9/mingw53_32/mkspecs/features/toolchain.prf:76: Variable QMAKE_DEFAULT_INCDIRS is not defined.
C:/Qt/Qt5.9.0/5.9/mingw53_32/mkspecs/features/toolchain.prf:129: Variable QMAKE_CXX.COMPILER_MACROS is not defined.
C:/Qt/Qt5.9.0/5.9/mingw53_32/mkspecs/features/toolchain.prf:76: Variable QMAKE_DEFAULT_INCDIRS is not defined.
C:/Qt/Qt5.9.0/5.9/mingw53_32/mkspecs/features/toolchain.prf:129: Variable QMAKE_CXX.COMPILER_MACROS is not defined.
C:/Qt/Qt5.9.0/5.9/mingw53_32/mkspecs/features/toolchain.prf:76: Variable QMAKE_DEFAULT_INCDIRS is not defined.
C:/Qt/Qt5.9.0/5.9/mingw53_32/mkspecs/features/toolchain.prf:129: Variable QMAKE_CXX.COMPILER_MACROS is not defined.
15:10:42: 进程"C:\Qt\Qt5.9.0\5.9\mingw53_32\bin\qmake.exe"正常退出。
15:10:42: 正在启动 "C:\Qt\Qt5.9.0\Tools\mingw530_32\bin\mingw32-make.exe" qmake_all
mingw32-make: Nothing to be done for 'qmake_all'.
15:10:43: 进程"C:\Qt\Qt5.9.0\Tools\mingw530_32\bin\mingw32-make.exe"正常退出。
15:10:43: Elapsed time: 00:03.
但是如果不进行Qmake,直接运行,就会跳过Qmake,界面就能运行。
而在MSVC2015下编译的时候,执行Qmake,也同样有上面的问题,但是在直接运行的时候出现下面的错误:
error: Failed to retrieve MSVC Environment from "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat":
The system cannot find the file specified.