开发者

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

开发者 https://www.devze.com 2023-03-22 13:22 出处:网络
After upgrading to Lion, and upgrading开发者_JAVA技巧 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

After upgrading to Lion, and upgrading开发者_JAVA技巧 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!


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


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.


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消