Search code examples
qtmingw32

Access denied when building a project


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.


Solution

  • There are at least two possible causes:

    1. The file you're trying to build is open/used (the program is running)
    2. You don't have sufficient privileges (you don't have admin rights)

    Cause #1 is often more likely than cause #2.