Mac OS X Lion and Xcode upgraded: missing headers and libs
Asked Answered
M

4

9

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!

Mesocratic answered 22/7, 2011 at 19:34 Comment(1)
I noticed /Developer/About Xcode.pdf says "UNIX Development. Command-line tools used for UNIX-based development. Its components are always placed in /usr - only one version installed at a time."Centi
C
23

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

Centi answered 22/7, 2011 at 20:56 Comment(1)
@ameyazing Just for completeness, if the file-names contains whitespace, you have to either escape the space with a backslash, or put the whole name in double-quotes.Petterson
Y
7

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.

Ytterbia answered 5/5, 2012 at 11:29 Comment(0)
T
2

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.

Tally answered 29/4, 2012 at 12:11 Comment(0)
A
0

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.

Avert answered 14/9, 2011 at 2:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.