c++代码在NetBeans 8.0中无法编译(msys mkdir可能存在的问题)

C++ Code Not Compiling in NetBeans 8.0 (possible issue with msys mkdir)

本文关键字:mkdir msys 存在 问题 编译 NetBeans 代码 c++      更新时间:2023-10-16

我一直在搜索堆栈和谷歌解决我的问题,但我还没有找到任何工作。我试图编译一些NetBeans附带的示例代码来测试它,但我一无所获。我一直得到以下错误

"/C/MinGW/msys/1.0/bin/make.exe" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make.exe[1]: Entering directory `/c/Users/Damian/Documents/NetBeansProjects/InputOutput_1'
"/C/MinGW/msys/1.0/bin/make.exe"  -f nbproject/Makefile-Debug.mk dist/Debug/MinGW-Windows/inputoutput_1.exe
make.exe[2]: Entering directory `/c/Users/Damian/Documents/NetBeansProjects/InputOutput_1'
mkdir -p build/Debug/MinGW-Windows/src
make.exe[2]: mkdir: Command not found
make.exe[2]: *** [build/Debug/MinGW-Windows/src/io.o] Error 127
make.exe[2]: Leaving directory `/c/Users/Damian/Documents/NetBeansProjects/InputOutput_1'
make.exe[1]: *** [.build-conf] Error 2
make.exe[1]: Leaving directory `/c/Users/Damian/Documents/NetBeansProjects/InputOutput_1'
make.exe": *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 2s)

我的NetBeans设置如下:

基本目录: C: MinGW bin
C编译器:C: MinGW bin gcc.exe
c++编译器:C: MinGW bin g++ . exe
Fortran编译器:C: MinGW bin gfortran.exe
汇编:C: MinGW bin as.exe
命令:C:MinGWmsys1.0binmake.exe
调试命令:C: MinGW bin gdb.exe

我设置了相应的PATH环境变量:
路径> C: MinGW msys 1.0 bin; C: MinGW bin;

我还确保mkdir.exe实际上是在"C:MinGWmsys1.0bin"。

>mkdir test123
##The result is folder "test123" being created in whatever 
##directory I was running the command prompt from

我注意到,当mkdir执行时,-p标志被应用,所以我在命令提示符中尝试了一下,它返回了以下错误:

C:UsersDamian>mkdir -P A/A/A/A
The syntax of the command is incorrect.

有人遇到类似的问题吗?如果相关的话,我使用了http://sourceforge.net/projects/mingw/files/Installer/上的"mingw-get-setup.exe"。我想不出其他的东西,我不知道为什么-p标志不起作用。我查了一下它的功能,它是用来创建嵌套文件夹的。无论使用哪种方式,都不能使用mkdir创建带或不带-p标志的嵌套文件夹。您只会得到错误提示"命令的语法不正确"。

不确定它是否有用,但我运行的是Windows 8.1(64位)。我也尝试过使用mingw32的mingw-w64分支(即。 http://sourceforge.net/projects/mingw-w64/),但我得到相同的错误

设置正确。如果您在安装MINGW之前/期间在netbeans上设置了设置,就会发生这种情况。重新启动netbeans