Netbeans和C ++安装 [英] Netbeans and C++ installation

查看:176
本文介绍了Netbeans和C ++安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个litle问题使用Netbeans 7.4和Cygwin 4.x编译我的C + +程序。我做了一切如在netbeans教程。我安装了gcc,gdb,g ++和make编译器。一切都在Netbeans属性,每个路径正确设置。但我仍然得到同样的问题,我不知道这是什么问题。我试图从Netbeans编译Hello样本。请帮帮我。这是错误日志:

i have a litle problem using Netbeans 7.4 and Cygwin 4.x for compiling my C++ programms. I've done everything as in netbeans tutorial. I've installed gcc, gdb, g++ and make compilers. Everything is setup properly in Netbeans properties, every path. But i still get the same problem, i don't know what is this problem. I'm trying to compile Hello sample from Netbeans. Please help me. Here is the error log:

"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory '/cygdrive/c/Users/Dragosh/Documents/NetBeansProjects/Welcome_2'
"/usr/bin/make"  -f nbproject/Makefile-Debug.mk dist/Debug/Cygwin_4.x-Windows/welcome_2.exe
make[2]: Entering directory '/cygdrive/c/Users/Dragosh/Documents/NetBeansProjects/Welcome_2'
mkdir -p build/Debug/Cygwin_4.x-Windows
g++    -c -g -o build/Debug/Cygwin_4.x-Windows/welcome.o welcome.cc
In file included from /usr/include/sys/reent.h:14:0,
             from /usr/include/wchar.h:6,
             from /usr/lib/gcc/x86_64-pc-cygwin/4.8.1/include/c++/cwchar:44,
             from /usr/lib/gcc/x86_64-pc-cygwin/4.8.1/include/c++/bits/postypes.h:40,
             from /usr/lib/gcc/x86_64-pc-cygwin/4.8.1/include/c++/iosfwd:40,
             from /usr/lib/gcc/x86_64-pc-cygwin/4.8.1/include/c++/ios:38,
             from /usr/lib/gcc/x86_64-pc-cygwin/4.8.1/include/c++/ostream:38,
             from /usr/lib/gcc/x86_64-pc-cygwin/4.8.1/include/c++/iostream:39,
             from welcome.cc:31:
/usr/include/sys/_types.h:72:20: fatal error: stddef.h: No such file or directory
#include <stddef.h>
                ^
compilation terminated.
nbproject/Makefile-Debug.mk:66: recipe for target 'build/Debug/Cygwin_4.x-Windows/welcome.o' failed
make[2]: *** [build/Debug/Cygwin_4.x-Windows/welcome.o] Error 1
make[2]: Leaving directory '/cygdrive/c/Users/Dragosh/Documents/NetBeansProjects/Welcome_2'
nbproject/Makefile-Debug.mk:59: recipe for target '.build-conf' failed
make[1]: *** [.build-conf] Error 2
make[1]: Leaving directory '/cygdrive/c/Users/Dragosh/Documents/NetBeansProjects/Welcome_2'
nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed
make: *** [.build-impl] Error 2


BUILD FAILED (exit value 2, total time: 467ms)


推荐答案

与cygwin也遇到这个问题,最后更新到2.830后(请参阅setup.exe版本)。我使用64位版本。为了验证我们有同样的问题,尝试手动编译一些超级简单g ++ usgin cygwin终端。

Got this issue with cygwin too, after last update to 2.830 (see setup.exe version). I am using 64 bit version. To verify that we have the same issue, try manualy compiling something supersimple with g++ usgin cygwin terminal.

我检查过:

$ echo -e "#include <iostream>\n int main() { return 0; }" | g++ -xc++ -

得到:

In file included from /usr/include/sys/reent.h:14:0,
                 from /usr/include/wchar.h:6,
                 from /usr/lib/gcc/x86_64-pc-cygwin/4.8.1/include/c++/cwchar:44,
                 from /usr/lib/gcc/x86_64-pc-cygwin/4.8.1/include/c++/bits/postypes.h:40,
                 from /usr/lib/gcc/x86_64-pc-cygwin/4.8.1/include/c++/iosfwd:40,
                 from /usr/lib/gcc/x86_64-pc-cygwin/4.8.1/include/c++/ios:38,
                 from /usr/lib/gcc/x86_64-pc-cygwin/4.8.1/include/c++/ostream:38,
                 from /usr/lib/gcc/x86_64-pc-cygwin/4.8.1/include/c++/iostream:39,
                 from <stdin>:1:
/usr/include/sys/_types.h:72:20: fatal error: stddef.h: No such file or directory
 #include <stddef.h>
                    ^
compilation terminated.

我注意到这里有两个gcc文件夹
C:\cygwin \ lib \gcc\x86_64-pc-cygwin\4.8.1
C:\cygwin\lib\gcc\x86_64-pc-cygwin\4.8.2

I noticed that there are two folders of gcc here C:\cygwin\lib\gcc\x86_64-pc-cygwin\4.8.1 C:\cygwin\lib\gcc\x86_64-pc-cygwin\4.8.2

和g ++ --version给出4.8.2

and g++ --version gives 4.8.2

运行Cygwin的最新Setup.exe并查找已安装的数据包显示版本不匹配gcc- core和gcc-g ++:

Running Cygwin's latest Setup.exe and looking for installed packets showed that versions mismatch for gcc-core and gcc-g++ :

gcc-core = 4.8.2-1
gcc-c++ = 4.8.1-3

我将gcc-core降级到4.8.1-3并解决了问题。

I downgraded gcc-core to 4.8.1-3 and fixed the issue.

这篇关于Netbeans和C ++安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆