qt - Qt 错误:“无法打开输出文件 debug\prog.exe:权限被拒绝”
问题描述
我正在使用 QtInstaller 附带的默认编译器工具包 MinGW 5.3.0 32 位在 Qt 5.11.1/Qt Creator 4.6.2 中进行开发。我的系统是 Windows 10 64 位。
经过几次没有任何错误的运行(几个月)后,有时我开始收到以下错误:
Cannot open output file debug\prog.exe: Permission denied
error: ld returned 1 exit status
File not found: collect2.exe
我已经打开任务管理器查看我的程序是否仍在运行,但那里没有任何条目。它似乎是“调试”文件夹中的可执行文件有问题,因为在那之后,我不允许删除 prog.exe。消息框说我没有正确的权限,但我是管理员用户。
仅当我重新启动 Windows 时问题才会消失。
这是我的 .pro 代码:
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = prog
TEMPLATE = app
DEFINES += QT_DEPRECATED_WARNINGS
SOURCES += \
main.cpp \
prog.cpp \
screen1.cpp \
screen2.cpp \
HEADERS += \
defineBotoes.h \
prog.h \
screen1.h \
screen2.h \
RESOURCES += \
resources/prog.qrc
DISTFILES +=
这是我的编译输出:
C:/Qt/Qt5.11.1/Tools/mingw530_32/bin/../lib/gcc/i686-w64-mingw32/5.3.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot open output file debug\prog.exe: Permission denied
collect2.exe: error: ld returned 1 exit status
Makefile.Debug:100: recipe for target 'debug\prog.exe' failed
mingw32-make[1]: Leaving directory 'C:/Users/RENAN-BCC/Desktop/STD/src/prog'
Makefile:36: recipe for target 'debug' failed
mingw32-make[1]: *** [debug\prog.exe] Error 1
mingw32-make: *** [debug] Error 2
08:31:49: The process "C:\Qt\Qt5.11.1\Tools\mingw530_32\bin\mingw32-make.exe" exited with code 2.
Error while building/deploying project prog (kit: Desktop Qt 5.11.1 MinGW 32bit)
When executing step "Make"
08:31:49: Elapsed time: 00:04.
有人能帮我吗?关于如何解决的任何想法?
解决方案
推荐阅读
- java - 如何使用 javax 中另一个 Json(合并 Json)的新内容更新 Json?
- reactjs - Jest 没有覆盖 useEffect 里面的函数
- flutter - 我在颤动时无法捕捉到 Firebase Auth 的异常
- python - 当列表元素可能或可能不作为列存在时,使用给定列表从 Pandas Dataframe 中过滤列
- json - 理想情况下,我应该在前端还是后端将响应(应用程序/XML)转换为 JSON?
- laravel - Laravel eloquent 依赖 belongsTo id
- node.js - 错误:Pm2 管理器节点 js 中的未知选项“--port”
- google-sheets - 使用部分日期/时间戳作为通配符标准的 Google 表格 SUMIF
- asp.net - ASP .Net 文本框中无法识别换行符
- arrays - 在程序开始时不知道大小的情况下声明 char 指针数组