Missing C++ header <__debug> after updating OSX Command Line Tools 6.3
Downgrade the Command Line Tools to 6.2 via Apple's Developer Download Page.
Be careful to download the correct version for your OS X:
- OS X 10.10
commandlinetoolsosx10.10forxcode6.2.dmg
- OS X 10.9
commandlinetoolsosx10.9forxcode6.2.dmg
This works because the inclusion of __debug
is conditionally guarded as follows in Command Line Tools 6.2 but not in 6.3.
#ifdef _LIBCPP_DEBUG# include <__debug>#else# define _LIBCPP_ASSERT(x, m) ((void)0)#endif
In my opinion this is the safest way, because:
- You don't compromise your toolchain
- You can easily upgrade via the App Store when Apple fixes the issue
- If you add a file manually you have to delete it later or more problems could occur
Update - 21.04.2015
Problem fixed by Apple.After installing Command Line Tools 6.3.1 everything works as expected!
Temporarily create the missing __debug
file where _LIBCPP_ASSERT
is defined as in Command Line Tools 6.2 for OS X.
echo '#define _LIBCPP_ASSERT(x, m) ((void)0)' | sudo tee -a /Library/Developer/CommandLineTools/usr/include/c++/v1/__debug > /dev/null
Remove the temporary file after the build finished.
sudo rm /Library/Developer/CommandLineTools/usr/include/c++/v1/__debug
Warning!!! This is a hack, use at your own risk!!! This work-around is only meant as a temporary fix until Apple provides an update to the command-line tools.
OK, here we go: Create the file yourself and put the following content into it:
#ifndef _LIBCPP_ASSERT#define _LIBCPP_ASSERT(...) ((void)0)#endif
This seems to work for me, but it is certainly not the right thing to do. Make sure the file is located at the right place /Library/Developer/CommandLineTools/usr/include/c++/v1/__debug
with the right owner/permissions.