我试图在netbeans中运行简单的C程序:

#include<stdio.h>
void main()
{
    printf("Hello");

}


=================================================

但是我收到以下错误:

cd 'C:\Users\bhatt\Documents\NetBeansProjects\CppApplication_1'
C:\cygwin64\bin\make.exe -f Makefile CONF=Debug
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory '/cygdrive/c/Users/bhatt/Documents/NetBeansProjects/CppApplication_1'
"/usr/bin/make"  -f nbproject/Makefile-Debug.mk dist/Debug/Cygwin-Windows/cppapplication_1.exe
make[2]: Entering directory '/cygdrive/c/Users/bhatt/Documents/NetBeansProjects/CppApplication_1'
mkdir -p build/Debug/Cygwin-Windows
rm -f "build/Debug/Cygwin-Windows/newfile.o.d"
gcc    -c -g -MMD -MP -MF "build/Debug/Cygwin-Windows/newfile.o.d" -o build/Debug/Cygwin-Windows/newfile.o newfile.c
newfile.c:6:1: fatal error: opening dependency file build/Debug/Cygwin-Windows/newfile.o.d: Permission denied
 }
 ^
compilation terminated.
nbproject/Makefile-Debug.mk:66: recipe for target 'build/Debug/Cygwin-Windows/newfile.o' failed
make[2]: *** [build/Debug/Cygwin-Windows/newfile.o] Error 1
make[2]: Leaving directory '/cygdrive/c/Users/bhatt/Documents/NetBeansProjects/CppApplication_1'
nbproject/Makefile-Debug.mk:59: recipe for target '.build-conf' failed
make[1]: *** [.build-conf] Error 2
make[1]: Leaving directory '/cygdrive/c/Users/bhatt/Documents/NetBeansProjects/CppApplication_1'
nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed
make: *** [.build-impl] Error 2

BUILD FAILED (exit value 2, total time: 956ms)
Please help urgently

最佳答案

这是主要问题:

newfile.c:6:1: fatal error: opening dependency file build/Debug/Cygwin-Windows/newfile.o.d: Permission denied


这意味着gcc实用程序无权在目录中创建新文件:build/Debug/Cygwin-Windows/

关于c - 无法在netbeans中运行我的C代码,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/40831420/

10-12 06:09