Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mac OS X Lion and Xcode upgraded: missing headers and libs

After upgrading to Lion, and upgrading Xcode, make can't seem to locate headers and libs. I looked in /usr/include. The only thing in there was 'parallels-server'. So, I renamed /usr/include to /usr/include.old, and made a symlink to:

/Developer/SDKs/MacOSX10.6.sdk/usr/include/

This is pretty evil. But, make can now find headers. Still can't locate libs (e.g., lcrt1.10.6.o).

What is the correct way to solve both the include and lib problems?

Thanks!

like image 936
gederer Avatar asked Jul 22 '11 19:07

gederer


3 Answers

After downloading Xcode 4 from the App Store, try running "/Applications/Install Xcode.app".

like image 137
njamesp Avatar answered Nov 11 '22 19:11

njamesp


From me, just downloading the Xcode Command line tools did the trick. (For that, of course, I had first to install Xcode itself, which I installed trough App Store.

  1. Start Xcode
  2. Open Xcode→Preferences...
  3. Select the Downloads tab
  4. Install the Command line tools

That installs a few packages, see /var/db/receipts. The package that contains /usr/include is com.apple.pkg.DevSDKLeo.

I don't think xcode-select is needed, but I had run that command before I downloaded the Command line tools, so I don't know for sure.

like image 7
Pekka Nikander Avatar answered Nov 11 '22 18:11

Pekka Nikander


To get Xcode to populate the /usr/include directory, run the following command:

sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer/

You may need to install the Xcode Command Line Tools within Xcode for this to work. Open the Preferences menu, then under Downloads install Command Line Tools.

like image 2
James Avatar answered Nov 11 '22 20:11

James