我已经在windows上安装了QT5.0.1 with mingw32
。当我创建一个项目并运行它时,一切都很完美。下次当我打开QT Qreator
并想要运行我的程序时,它有以下错误:
:-1: error: error: ..untitled2main.cpp: No such file or directory
从构建菜单我点击了qmake
,它没有错误。这是。pro文件
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = untitled1
TEMPLATE = app
SOURCES += main.cpp
mainwindow.cpp
contentcontrol.cpp
HEADERS += mainwindow.h
contentcontrol.h
FORMS += mainwindow.ui
contentcontrol.ui
这是编译输出:
22:17:17: Running steps for project untitled1...
22:17:17: Configuration unchanged, skipping qmake step.
22:17:17: Starting: "C:QtQt5.0.1ToolsMinGWbinmingw32-make.exe"
C:/Qt/Qt5.0.1/Tools/MinGW/bin/mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory 'C:/Users/(Mahdi)/Documents/QT/untitled1-build-Desktop_Qt_5_0_1_MinGW_32bit-Debug'
g++ -c -pipe -fno-keep-inline-dllexport -g -frtti -Wall -Wextra -fexceptions -mthreads -DUNICODE -DQT_QML_DEBUG -DQT_DECLARATIVE_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_OPENGL_ES_2 -DQT_OPENGL_ES_2_ANGLE -DQT_NEEDS_QMAIN -I..untitled1 -I"..........QtQt5.0.15.0.1mingw47_32include" -I"..........QtQt5.0.15.0.1mingw47_32includeQtWidgets" -I"..........QtQt5.0.15.0.1mingw47_32includeQtGui" -I"..........QtQt5.0.15.0.1mingw47_32includeQtCore" -I"debug" -I"." -I"." -I"..........QtQt5.0.15.0.1mingw47_32mkspecswin32-g++" -o debugmain.o ..untitled1main.cpp
g++.exe: error: ..untitled1main.cpp: No such file or directory
g++.exe: fatal error: no input files
compilation terminated.
Makefile.Debug:477: recipe for target 'debug/main.o' failed
mingw32-make[1]: *** [debug/main.o] Error 1
mingw32-make[1]: Leaving directory 'C:/Users/(Mahdi)/Documents/QT/untitled1-build-Desktop_Qt_5_0_1_MinGW_32bit-Debug'
makefile:34: recipe for target 'debug' failed
mingw32-make: *** [debug] Error 2
22:17:18: The process "C:QtQt5.0.1ToolsMinGWbinmingw32-make.exe" exited with code 2.
Error while building/deploying project untitled1 (kit: Desktop Qt 5.0.1 MinGW 32bit)
When executing step 'Make'
是什么问题?
为以后的视图:我通过向环境变量
添加值来解决这个问题path:
C:QtQt5.0.15.0.1mingw47_32bin;C:QtQt5.0.1ToolsMinGWbin
QTDIR:
C:QtQt5.0.15.0.1mingw47_32
我有同样的问题。修复了项目/建筑环境/清除系统环境中设置为true的复选框。