Netbeans 7.4运行时出现问题

Trouble getting Netbeans 7.4 working

本文关键字:问题 运行时 Netbeans      更新时间:2023-10-16

嗨,我想试试c++,但我无法让netbeans编译器为你好世界工作。。。。。这是我从教程粘贴的代码副本:

#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)

在我看来,您将源文件命名为hello world.cpp。NetBeans似乎不喜欢这种语法。

命名文件的规范方法是不使用空格。helloworld.cpp会更好地为您服务。