问题
I’m working on a project with opencv lib. I use Qt 4.8 on Windows 7 and it gives me an error when building the project:
mingw32-make.exe[1]: *** Access is denied.
. Stop.
mingw32-make.exe: *** [release] Error 2
19:05:06: The process "F:\QtSDK\mingw\bin\mingw32-make.exe" exited with code 2.
Error while building project TraySystemtry (target: Desktop)
When executing build step 'Make'
The pro file:
QT += xml svg core gui
CONFIG += qt
VERSION = 0.3.0
TEMPLATE = app
INCLUDEPATH += D:\OpenCV\opencv\build\include
LIBS += -LD:\OpenCV\opencv_Build\bin\
-lopencv_core242 \
-lopencv_highgui242 \
-lopencv_imgproc242 \
-lopencv_features2d242 \
-lopencv_calib3d242 \
-lopencv_objdetect242
HEADERS += \
window.h \
aboutus.h \
abouttab.h \
developertab.h \
privacytab.h \
classificationhand.h \
keyssetup.h
SOURCES += \
window.cpp \
main.cpp \
aboutus.cpp \
abouttab.cpp \
developertab.cpp \
privacytab.cpp \
classificationhand.cpp \
keyssetup.cpp
RESOURCES += \
systray.qrc
I can’t figure out the problem.
回答1:
There are at least two possible causes:
- The file you're trying to build is open/used (the program is running)
- You don't have sufficient privileges (you don't have admin rights)
Cause #1 is often more likely than cause #2.
回答2:
I have the same problem. For mine, I resolved it just disabling the antivirus (Kaspersky). The antivirus was denying mingw32-make.
回答3:
For me it usually means that the exe that I'm trying to compile is currently open (i.e., running). This often happens when I have it running in debug mode, then try to recompile.
来源:https://stackoverflow.com/questions/17153187/access-denied-when-building-a-project