C++ 在 MaveRicks 更新后未在 NetBeans 中编译
c++ not compiling in netbeans after mavericks update
像往常一样,在发布之前,我尝试阅读了许多论坛,谷歌答案,但仍然找不到问题。我有一段工作正常的代码。它在任何 linux dist 中编译,之前在美洲狮中编译,并且从终端编译,当我尝试通过 netbeans 7.4 编译它时,我收到以下错误下面是编译命令:
g++ -c -g -I../../Downloads/boost_1_50_0 -I. -I../../Downloads/RInside/inst/include -I/Library/Developer/CommandLineTools/usr/bin/../lib/clang/5.0/include -I/ -I/Library/Developer/CommandLineTools/usr/include -I/usr/include -I/usr/include/c++/4.2.1 -MMD -MP -MF "build/Debug/GNU-MacOSX/main.o.d" -o build/Debug/GNU-MacOSX/main.o main.cpp
这是错误
In file included from main.cpp:7:
In file included from /usr/include/c++/4.2.1/cstdlib:71:
In file included from /usr/include/stdlib.h:65:
In file included from /usr/include/sys/wait.h:110:
/usr/include/sys/resource.h:193:2: error: unknown type name 'uint8_t'
uint8_t ri_uuid[16];
^
/usr/include/sys/resource.h:194:2: error: unknown type name 'uint64_t'
uint64_t ri_user_time;
第7行内容如下:
#include <cstdlib>
我想这是包含库的问题,但这只是一个猜测,我重新安装了netbeans,获得了java 1.7.0_45,安装了命令行工具,删除cache_dir,仍然是同样的问题,真正奇怪的部分是当我从终端编译它时
g++ main.cpp -o main -I./
那行得通....以前我有美洲狮的时候它就起作用了......任何帮助将不胜感激。最好乔治
好的,所以一个朋友建议开始删除库,直到命令运行(因为使用简单的 sintax,它在命令终端中运行),这正是我所做的,这就是导致问题的库:
-I/Library/Developer/CommandLineTools/usr/bin/../lib/clang/5.0/include
似乎当 mavericks 更新时它会切换到 clang,所以不知何故,这一行导致了代码正确编译的问题,我希望我对正在发生的事情有一个正确的答案,但至少这会解决问题,任何正确的答案将不胜感激:)
类似的问题也发生在我身上(但对于叮当声)。Brew帮助我解决了这个问题。 brew doctor
列出了很多头文件(全部/usr/include/
,有一些警告我现在不记得了。
简单地移动这些头文件对我有用。
相关文章:
- 犰狳代码无法在 msys2 和 netbeans 中编译
- 无法在 Netbeans 中编译单个C++文件,但能够生成完整的项目
- 使用netbeans编译C++
- 在 netbeans 中编译项目中的单个文件
- C++ 在 MaveRicks 更新后未在 NetBeans 中编译
- 指定netbeans用来编译C++程序的完整编译命令
- 如何强制 Netbeans 只使用 -ggdb 编译标志而不使用它,同时在 Makefile-Debug.mk 中自动发
- C++编译和运行在Geany中,而不是在Netbeans,Eclipse,Code::Blocks中。为什么?
- 在VS 2012上编译,但不使用Netbeans/MinGW-重载<<
- 如何使预编译的头文件在Netbeans上工作
- 在Netbeans上编译和运行OpenGL代码
- 在 NetBeans 中编译基于 Qt 的C++代码时出错
- Netbeans :在编译命令末尾添加"Compile Line - Additional Options" "-lboost_system"
- Netbeans 7.3.1与Qt 4.8.5-无法编译
- Boost 库未在 Netbeans 中使用 G++ 进行编译
- 我的C++DLL无法编译,除非我第一次打开项目(在Netbeans中)
- Netbeans C/C++多文件编译
- 使用 minGW 的 Netbeans 在编译时无法识别系统
- 无法在Mac OS上使用Netbeans 7.0编译C++代码
- Netbeans c++编译错误