mac /include/c++/v1/iterator:341:10: fatal error: '__debug' file not found #include <__debug>


1.问题描述

在mac 下编译c++程序会报如下错误:

MacBook-Pro:~/Documents/data_structure/Sort/Merge $g++ merge_sort.cpp 

In file included from merge_sort.cpp:1:

In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/iostream:38:

In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/ios:216:

In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/__locale:15:

In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/string:439:

In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/algorithm:628:

In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/memory:604:

/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/iterator:341:10: fatal  

      found

#include <__debug>

         ^

1 error generated.



2.解决方法

echo '#define _LIBCPP_ASSERT(x, m) ((void)0)' | sudo tee -a /Library/Developer/CommandLineTools/usr/include/c++/v1/__debug > /dev/null


3.reference

https://github.com/google/protobuf/issues/74

http://sleepythread.blogspot.com/2013/11/installing-protoc-25x-compiler-google.html

https://github.com/JuliaLang/julia/issues/10822

http://stackoverflow.com/questions/29529455/missing-c-header-debug-after-updating-osx-command-line-tools-6-3

http://www.cnblogs.com/yanghuahui/p/4448728.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值