Netbeans C ++ hello world编译错误:权限被拒绝?

时间:2014-12-10 23:54:56

标签: c++ netbeans compiler-errors

我在Windows 8桌面上。我有我的开发环境(“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,但我仍然收到“权限被拒绝”错误。请帮忙!

0 个答案:

没有答案