您好以为我会尝试使用c ++,但是我无法让netbeans编译器为hello世界工作.....所以这是我从教程中粘贴的代码副本:
#include <iostream>
using namespace std;
int main()
{
cout << "Hello World!" << endl;
return 0;
}
这是我得到的错误消息:
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory '/cygdrive/c/Users/Jeremy/Documents/NetBeansProjects/Hello World'
cygwin warning:
MS-DOS style path detected: build/Debug/Cygwin-Windows/hello\.d
Preferred POSIX equivalent is: build/Debug/Cygwin-Windows/hello/.d
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
"/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/Cygwin-Windows/hello_world.exe
make[2]: Entering directory '/cygdrive/c/Users/Jeremy/Documents/NetBeansProjects/Hello World'
mkdir -p build/Debug/Cygwin-Windows
rm -f build/Debug/Cygwin-Windows/hello world.o.d
g++ -c -g -MMD -MP -MF build/Debug/Cygwin-Windows/hello world.o.d -o build/Debug/Cygwin-Windows/hello\ world.o hello\ world.cpp
g++: error: world.o.d: No such file or directory
nbproject/Makefile-Debug.mk:68: recipe for target 'build/Debug/Cygwin-Windows/hello world.o' failed
make[2]: *** [build/Debug/Cygwin-Windows/hello world.o] Error 1
make[2]: Leaving directory '/cygdrive/c/Users/Jeremy/Documents/NetBeansProjects/Hello World'
nbproject/Makefile-Debug.mk:60: recipe for target '.build-conf' failed
make[1]: *** [.build-conf] Error 2
make[1]: Leaving directory '/cygdrive/c/Users/Jeremy/Documents/NetBeansProjects/Hello World'
nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed
make: *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 3s)
答案 0 :(得分:0)
在我看来,就像你命名了你的源文件hello world.cpp
一样。 NetBeans似乎不喜欢这种语法。
命名文件的规范方法是没有空格。 helloworld.cpp
会更适合您。