无法在 netbeans 中运行我的 C 代码

标签 c netbeans makefile

我正在尝试在 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/

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

相关文章:

c - POSIX 消息队列,errno 90,消息太长

php - 使用NetBeans调试PHP脚本修改表记录时, 'affected_rows'会由1变为-1

java - 错误: code too large in netbeans

c - 未知类型名称 '__uint64_t'

c++ - ID2D1HwndRenderTarget 总是有黑色背景而不是透明

c - 指针运算和数组 : what's really legal?

c - Makefile 基础知识

makefile - 强制 make 使用更具体的规则

c - "TCPL"中的多源文件链接之谜

java - 无法找到正确的 JVM 选项