Skip to content

Instantly share code, notes, and snippets.

@greghaygood
Last active September 21, 2015 20:12
Show Gist options
  • Save greghaygood/18acc8e12358fcb1e80f to your computer and use it in GitHub Desktop.
Save greghaygood/18acc8e12358fcb1e80f to your computer and use it in GitHub Desktop.
'unistd.h' file not found for Xcode 7

After upgrading to Xcode7 and Command Line Tools 10.10, I can't compile standard programs anymore. The error is (from the cputhrottle package):

/tmp/cputhrottle% make
/usr/bin/g++ -c -g -Wall -I..///boost_1_43_0 cputhrottle.cc
In file included from cputhrottle.cc:5:
In file included from ./manip.h:4:
In file included from /usr/local/include/boost/shared_ptr.hpp:17:
In file included from /usr/local/include/boost/smart_ptr/shared_ptr.hpp:17:
In file included from /usr/local/include/boost/config.hpp:44:
In file included from /usr/local/include/boost/config/select_stdlib_config.hpp:18:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstddef:36:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config:23:10: fatal error:
      'unistd.h' file not found
#include <unistd.h>
         ^
1 error generated.
make: *** [cputhrottle.o] Error 1

Downloading and installed the Command Line Tools 10.10 for Xcode 6.4 fixed it, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment