2014-05-03 118 views
2

當我在Netbeans中編譯此程序時,程序在輸出中顯示文本 - 我在做什麼錯誤導致此錯誤,我該如何解決?無法在Netbeans中編譯Hello World

這是我使用的代碼:

/* 
* File: main.cpp 
* Author: Oliver 
* 
* Created on May 4, 2014, 12:33 AM 
*/ 
#include <iostream> 
using namespace std; 

int main(int argc, char** argv) { 
    cout << "Hello World!"; 
    return 0; 
} 

這是結果...:

"/C/MinGW/msys/1.0/bin/make.exe" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf 
make.exe[1]: Entering directory `/c/sers/Oliver/Documents/NetBeansProjects/Learning' 
"/C/MinGW/msys/1.0/bin/make.exe" -f nbproject/Makefile-Debug.mk dist/Debug/MinGW-Windows/learning.exe 
make.exe[2]: Entering directory `/c/sers/Oliver/Documents/NetBeansProjects/Learning' 
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/sers/Oliver/Documents/NetBeansProjects/Learning' 
make.exe[1]: *** [.build-conf] Error 2 
make.exe[1]: Leaving directory `/c/sers/Oliver/Documents/NetBeansProjects/Learning' 
make.exe": *** [.build-impl] Error 2 

BUILD FAILED (exit value 2, total time: 1s) 
+1

這條線:'MKDIR -p建立/調試/ MinGW的-Windows'失敗。確保可以從當前用戶的控制檯直接訪問mkdir命令。 – Stefan

回答

0

看着你/C/MinGW/msys/1.0/bin/mkdir.exe

如果您在那裏發現它,您尚未將您的path environment variable設置爲該文件夾。

C:\MinGW\msys\1.0\bin;C:\MinGW\bin; 

所以在首位添加。

我對這幅有點非典型的圖片表示歉意。 Binn目前在win2000電腦上工作,無法切換。

enter image description here

0

如果這還不夠,你可以手動 「的make.exe」 設置到C/C++的NetBeans屬性> make命令文本框。

它位於上一個答案中說的路徑中。

C:\ MinGW的\ MSYS \ 1.0 \ BIN \的make.exe