9

Lion にアップグレードし、Xcode をアップグレードした後 make がヘッダーとライブラリを見つけられないようです。/usr/include を調べました。そこにあるのは「parallels-server」だけでした。そこで、/usr/include の名前を /usr/include.old に変更し、次へのシンボリック リンクを作成しました。

/開発者/SDKs/MacOSX10.6.sdk/usr/include/

これはかなり悪いです。しかし、make はヘッダーを見つけることができるようになりました。まだライブラリが見つかりません (例: lcrt1.10.6.o)。

include と lib の問題の両方を解決する正しい方法は何ですか?

ありがとう!

4

4 に答える 4

23

App Store から Xcode 4 をダウンロードしたら、「/Applications/Install Xcode.app」を実行してみてください。

于 2011-07-22T20:56:01.317 に答える
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.

于 2012-05-05T11:29:17.280 に答える
2

Xcode に /usr/include ディレクトリを設定させるには、次のコマンドを実行します。

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

これを機能させるには、Xcode 内に Xcode コマンド ライン ツールをインストールする必要がある場合があります。[設定] メニューを開き、[ダウンロード] で [コマンド ライン ツール] をインストールします。

于 2012-04-29T12:11:16.110 に答える
0

njamespによる上記の回答は、次のエラーにも対処しています。

configure: error: C compiler cannot create executables

10.5 タイム マシンからセットアップした後、10.7 システムでコードをコンパイルしようとしたときにこのエラーを受け取ったので、間違ったバージョンの xcode がシステムにインストールされていると思います。

于 2011-09-14T02:27:32.713 に答える