繁体   English   中英

特立独行更新后,c ++无法在netbeans中编译

[英]c++ not compiling in netbeans after mavericks update

和往常一样,在发布之前,我已经尝试阅读许多论坛,google答案,但仍然找不到问题。 我有一段有效的代码。 它可以在任何Linux发行版中进行编译,之前它是在山狮中进行编译的,并且它是从终端进行编译的,当我尝试通过netbeans 7.4进行编译时,出现以下错误这是compile命令:

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

看来,当特立独行者更新时,它会切换为clang,因此,这行代码以某种方式导致代码正确编译出现问题,我希望我对正在发生的事情有一个正确的答案,但这至少可以解决问题,任何适当的答案将不胜感激:)

我也发生了类似的问题(但叮当声)。 布鲁尔帮助我解决了这个问题。 brew doctor列出了很多头文件(都在/usr/include/ ,有些警告我现在不记得了。

只需移动这些头文件就可以为我工作。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM