我无法在NetBeans中构建C / C ++项目。 environment variable
已正确设置。
错误:
"/C/MinGW/msys/1.0/bin/make.exe" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make.exe[1]: Entering directory `/c/Users/Rahul/Documents/NetBeansProjects/CppApplication_1'
"/C/MinGW/msys/1.0/bin/make.exe" -f nbproject/Makefile-Debug.mk dist/Debug/MinGW-Windows/cppapplication_1.exe
make.exe[2]: Entering directory `/c/Users/Rahul/Documents/NetBeansProjects/CppApplication_1'
mkdir -p build/Debug/MinGW-Windows
make.exe[2]: mkdir: Command not found
make.exe[2]: *** [build/Debug/MinGW-Windows/main.o] Error 127
make.exe[2]: Leaving directory `/c/Users/Rahul/Documents/NetBeansProjects/CppApplication_1'
make.exe[1]: *** [.build-conf] Error 2
make.exe[1]: Leaving directory `/c/Users/Rahul/Documents/NetBeansProjects/CppApplication_1'
make.exe": *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 2s)
代码:
#include <stdio.h>
int main(void) {
printf("hello");
return 0;
}
NetBeans-1:
NetBeans-2:
答案 0 :(得分:0)
问题是来自msys的“make”会查找msys mkdir但找不到它,因为你没有在msys环境中运行。
解决此问题的安全方法是从msys shell启动NetBeans。
或者你可以手动创建目录,因为gcc / g ++ / ...本身也可以在msys环境之外的路径上找到。