簡體   English   中英

Netbeans和C ++安裝

[英]Netbeans and C++ installation

我在使用Netbeans 7.4和Cygwin 4.x編譯C ++程序時遇到了一個小問題。 我已經完成了與netbeans教程一樣的所有操作。 我已經安裝了gcc,gdb,g ++並制作了編譯器。 在Netbeans屬性中的每條路徑中,所有內容均已正確設置。 但是我仍然遇到同樣的問題,我不知道這是什么問題。 我正在嘗試從Netbeans編譯Hello示例。 請幫我。 這是錯誤日志:

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

在最后一次更新到2.830(請參閱setup.exe版本)之后,cygwin也遇到了此問題。 我正在使用64位版本。 要驗證我們是否存在相同的問題,請嘗試使用g ++ usgin cygwin終端手動編譯一些超級簡單的東西。

我檢查了:

$ 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

和g ++ --version提供4.8.2

運行Cygwin的最新Setup.exe並查找已安裝的數據包,表明gcc-core和gcc-g ++的版本不匹配:

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

我將gcc-core降級為4.8.1-3,並修復了該問題。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM