I was trying to build an app which depends on PJSIP lib which should have some headers in /usr/include. But there is no /usr/include folder, and I can't create one even my account has administrator rights.

How can be include folder, activated/created/restored ?

up vote 15 down vote accepted

Update (12 Feb 2016):

I finally installed El Capitan and can now confirm that Ondřej Čertík's answer is correct. I strongly recommend installing the command line developer tools instead of disabling SIP.

As Ondřej noted, simply installing Xcode will not install all of the command line developer tools. You must execute xcode-select --install in Terminal.


Original post (5 Dec 2015):

Write access to /System, /bin, /sbin, /usr, /etc, /tmp and /var has been disabled by default in El Capitan, even for root. This is due to the new Security Integrity Protection feature.

To disable SIP, boot into recovery mode and execute the command csrutil disable in Terminal.

Disclaimer: I have not tested this myself since I have not yet upgraded to El Capitan.

  • 1
    Confirmed ! Works in El Capitan too – pun Dec 5 '15 at 4:18
  • 1
    I've already figure it out, and forgot to answer to my own question. I'll accept yours as it's correct. – tesla Dec 5 '15 at 12:17
  • 3
    On my system, the proper fix was to just install the /usr/include using xcode-select --install and leave SIP enabled. See my answer below for more info. – Ondřej Čertík Dec 17 '15 at 18:27

By default, when you install Xcode ("developer tools") from the App Store on El Capitan, it does not install the "command line developer tools" which include the /usr/include. To install the "command line developer tools", execute xcode-select --install, it will prompt you about whether you want to get Xcode+command line tools from the App Store (but I already have Xcode installed from the App Store and it apparently does not include the command line utilities), so I selected "install" and that installed /usr/include among other things.

As to the System Integrity Protection (SIP), leave that enabled, as that seems to be a good thing. The reason xcode-select --install managed to install into the protected /usr directory is probably because xcode-select is whitelisted by SIP.

  • 1
    I thought Xcode 8.x included the command line tools, but just needed to do this on a fresh install of MacOS Sierra. I installed Xcode first, then still had to do the xcode-select --install to get the tools. – leanne May 24 '17 at 1:13

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.