gederer
gederer

Reputation: 105

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!

Upvotes: 9

Views: 15828

Answers (4)

Pekka Nikander
Pekka Nikander

Reputation: 1605

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.

Upvotes: 7

James
James

Reputation: 151

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.

Upvotes: 2

keflavich
keflavich

Reputation: 19235

The above answer by njamesp also addresses the following error:

configure: error: C compiler cannot create executables

I received this error when trying to compile code on my 10.7 system after setting it up from a 10.5 time machine, so I assume the wrong version of xcode was installed on my system.

Upvotes: 0

njamesp
njamesp

Reputation: 760

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

Upvotes: 23

Related Questions