无法构建NetBeans C / C ++项目

时间:2015-01-22 19:50:25

标签: c++ netbeans build

我无法在NetBeans中构建C / C ++项目。 environment variable已正确设置。

enter image description here


错误:

"/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:
enter image description here


NetBeans-2:
enter image description here

1 个答案:

答案 0 :(得分:0)

问题是来自msys的“make”会查找msys mkdir但找不到它,因为你没有在msys环境中运行。

解决此问题的安全方法是从msys shell启动NetBeans。

或者你可以手动创建目录,因为gcc / g ++ / ...本身也可以在msys环境之外的路径上找到。