Xcode 5.1 找不到实用程序"make",不是开发人员工具或在 PATH 中



我正在尝试按照这些说明安装Google协议缓冲区。 创建脚本后,我尝试使用以下命令运行它:

$ ./build-proto-ios.sh

我收到以下输出:

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/Content/Developer

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

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

4( 评估 "$(rbenv init -(">

5( RBENV 安装 2.5.3

6( RBENV 本地 2.5.3

另外,查看 xcode 是否已正确更新

看起来这不是你的实际问题。当脚本运行时,它会在 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(尚未构建。

祝你好运!

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。如果可以,原型缓冲区构建脚本可能是问题所在。

对我来说,这是因为SDKROOT的错误路径。这解决方案对我有用。

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

相关内容

最新更新