NETBeaBeC++:Hello World编译错误:权限被拒绝?

NETBeaBeC++:Hello World编译错误:权限被拒绝?,c++,netbeans,compiler-errors,C++,Netbeans,Compiler Errors,我在Windows8桌面上。我的开发环境netbeans+mingw已经设置好,并且工作得很好。我考虑安装VS社区,所以我卸载了netbeans。我几乎立即将netbeans 8.0重新安装到我的计算机上。我仍然有MinGW设置,所以我再次运行netbeans,并尝试构建一个简单的helloworld程序来检查一切是否正常 但是我现在遇到了问题 因此,在我构建这个简单的程序之后,我得到以下错误消息: "/C/MinGW/msys/1.0/bin/make.exe" -f nbproject/Ma

我在Windows8桌面上。我的开发环境netbeans+mingw已经设置好,并且工作得很好。我考虑安装VS社区,所以我卸载了netbeans。我几乎立即将netbeans 8.0重新安装到我的计算机上。我仍然有MinGW设置,所以我再次运行netbeans,并尝试构建一个简单的helloworld程序来检查一切是否正常

但是我现在遇到了问题

因此,在我构建这个简单的程序之后,我得到以下错误消息:

"/C/MinGW/msys/1.0/bin/make.exe" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make.exe[1]: Entering directory `/c/Users/Owner/Documents/NetBeansProjects/Practice'
"/C/MinGW/msys/1.0/bin/make.exe"  -f nbproject/Makefile-Debug.mk dist/Debug/MinGW-Windows/practice.exe
make.exe[2]: Entering directory `/c/Users/Owner/Documents/NetBeansProjects/Practice'
make.exe[2]: stat: dist/Debug/MinGW-Windows/practice.exe: Permission denied
mkdir -p build/Debug/MinGW-Windows
rm -f "build/Debug/MinGW-Windows/main.o.d"
g++    -c -g -MMD -MP -MF "build/Debug/MinGW-Windows/main.o.d" -o build/Debug/MinGW-Windows/main.o main.cpp
mkdir -p dist/Debug/MinGW-Windows
g++     -o dist/Debug/MinGW-Windows/practice build/Debug/MinGW-Windows/main.o 
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot open output file dist/Debug/MinGW-Windows/practice.exe: Permission denied
collect2.exe: error: ld returned 1 exit status
make.exe[2]: *** [dist/Debug/MinGW-Windows/practice.exe] Error 1
make.exe[2]: Leaving directory `/c/Users/Owner/Documents/NetBeansProjects/Practice'
make.exe[1]: *** [.build-conf] Error 2
make.exe[1]: Leaving directory `/c/Users/Owner/Documents/NetBeansProjects/Practice'
make.exe": *** [.build-impl] Error 2

BUILD FAILED (exit value 2, total time: 11s)
我的问题是…为什么?我做错了什么?我非常确定IDE的配置与上次相同。为什么我以前没有得到许可呢?我在没有管理员许可的情况下运行程序从来没有遇到过任何问题,那么为什么现在需要它呢

代码如下:

#include <iostream>
#include <cstdlib>

using namespace std;

int main() {
    cout << "Hello, World!" << endl;
    return 0;
}

更新:我试着按照你的建议删除了可执行文件,但仍然不起作用。我还尝试以管理员身份运行netbeans,但仍然收到权限拒绝错误。请帮忙

您确定您的程序的旧版本不再运行了吗?如果是,它将阻止您覆盖可执行文件。请进入文件夹dist/Debug/MinGW Windows/并删除practice.exe,然后尝试重新生成可能的副本