简体   繁体   English

无法在Netbeans中编译Hello World

[英]Can't Compile Hello World in Netbeans

when I compile this program in Netbeans, the program shows the text in the output- What is it I'm doing wrong that causes this error and how do I fix it? 当我在Netbeans中编译该程序时,该程序在输出中显示文本-我做错了什么导致该错误,并且该如何解决?

This is the Code I'm using: 这是我正在使用的代码:

/* 
 * 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;
}

This is the results...: 这是结果...:

"/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)

Look into your /C/MinGW/msys/1.0/bin/ for mkdir.exe . /C/MinGW/msys/1.0/bin/查找mkdir.exe

if you found it there, you have not set your path environment variable to that folder. 如果在此找到它,则尚未将path environment variable设置为该文件夹。

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

So add it at the first place. 因此,首先添加它。

I apologize for the somewhat atypical picture. 对于有些不典型的图片,我深表歉意。 Binn currently working on a win2000 computer and can not switch. Binn当前在win2000计算机上工作,无法切换。

在此处输入图片说明

If this is not enough, you can set manually "make.exe" into the C/C++ NetBeans Properties > Make Command textbox. 如果这还不够,您可以在“ C / C ++ NetBeans属性”>“创建命令”文本框中手动设置“ make.exe”。

It's located in the path said in the previous answer. 它位于上一个答案中所述的路径中。

C:\\MinGW\\msys\\1.0\\bin\\make.exe C:\\ MinGW \\ msys \\ 1.0 \\ bin \\ make.exe

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM