簡體   English   中英

Xcode 5.1 無法找到實用程序“make”,不是開發人員工具或在 PATH 中

[英]Xcode 5.1 unable to find utility "make", not a developer tool or in PATH

我正在嘗試按照這些說明安裝 Google Protocol Buffers。 創建腳本后,我嘗試使用以下命令運行它:

$ ./build-proto-ios.sh

我收到以下 output:

mkdir: ios-build: File exists
Platform is iPhoneSimulator
./build-proto-ios.sh: line 40: ./configure: No such file or directory
make: error: unable to find utility "make", not a developer tool or in PATH
make: error: unable to find utility "make", not a developer tool or in PATH
cp: src/.libs/libprotobuf-lite.a: No such file or directory
Platform is iPhoneOS
./build-proto-ios.sh: line 40: ./configure: No such file or directory
make: error: unable to find utility "make", not a developer tool or in PATH
make: error: unable to find utility "make", not a developer tool or in PATH
cp: src/.libs/libprotobuf-lite.a: No such file or directory
Platform is iPhoneOS
./build-proto-ios.sh: line 40: ./configure: No such file or directory
make: error: unable to find utility "make", not a developer tool or in PATH
make: error: unable to find utility "make", not a developer tool or in PATH
cp: src/.libs/libprotobuf-lite.a: No such file or directory
make: error: unable to find utility "make", not a developer tool or in PATH
fatal error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: can't open input file: ios-build/libprotobuf-lite-armv7.a (No such file or directory)

因此,我查找了以下信息:

無法找到實用程序“make”,不是開發人員工具或在 PATH 中

我找到了安裝 Xcode 命令行工具的信息,因為我認為這可能是原因。 但即使在為 OS X Mavericks 安裝了最新的命令行工具之后,我仍然會收到此錯誤。

有任何想法嗎?

1) xcode-select -p -> /Applications/Xcode.app/Contents/Developer

2) sudo xcode-select --switch /Library/Developer/CommandLineTools

3) xcode-select -p -> /Library/Developer/CommandLineTools

4) eval "$(rbenv init -)"

5) rbenv 安裝 2.5.3

6) rbenv 本地 2.5.3

另外,請參閱 xcode 已正確更新

Make 包含在 Xcode 中。 您無需安裝命令行工具即可使用它。 它存在於 Xcode 應用程序中:

/Applications/Xcode.app/Contents/Developer/usr/bin/make

並且可以使用xcrun訪問。

xcrun make

如果由於某種原因未設置活動開發人員目錄或不正確,這仍然可能失敗。 例如,如果您移動了 Xcode,就會發生這種情況。

使用xcode-select設置它

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

檢查您是否可以從命令行會話使用這些方法訪問 make。 如果可以,原型緩沖區構建腳本可能是問題所在。

看起來這不是你的實際問題。 當腳本運行時,它會在 iOS 6 文件夾中尋找包含的 make ......這可能不存在。

查看https://gist.github.com/PR3x/0fde040902ed4e9a1a61的腳本,該腳本將為您構建 protobuf 作為胖庫。 只需將它放在一個新文件夾中,chmod +x,然后運行。 (基於https://stackoverflow.com/a/19582682/939927

需要注意的一件事是,您需要更改所有生成的.pb.*文件以使用::google_public:命名空間而不是::google: ,因為 Apple 在內部使用它。

另一件需要注意的是,這只適用於 32 位 ARM 和模擬器。 64 位 ARM(iPhone 5s)尚未構建。

祝你好運!

對我來說,是因為SDKROOT路徑錯誤。 這個解決方案對我有用。

xport SDKROOT=$(xcrun -sdk macosx --show-sdk-path

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM