首页 > 解决方案 > 尝试在第 4 次安装命令中为 J2ObjC 安装 Protobuf 时出错

问题描述

我已经为此工作了一两天了,我似乎无法在任何地方找到关于这个特定问题的明确说明:

当我尝试使用终端为 macOS 构建最新版本的 protobuf 时,运行后

$ ./configure
$ make
$ make check
$ sudo make install

我收到以下错误:

Making install in .
make[2]: Nothing to be done for `install-exec-am'.
 ./install-sh -c -d '/usr/lib/pkgconfig'
 /usr/bin/install -c -m 644 protobuf.pc protobuf-lite.pc '/usr/lib/pkgconfig'
install: /usr/lib/pkgconfig/protobuf.pc: Operation not permitted
make[2]: *** [install-pkgconfigDATA] Error 71
make[1]: *** [install-am] Error 2
make: *** [install-recursive] Error 1

我曾尝试运行“make clean”然后重新编译,但这似乎没有帮助,我似乎无法在网上找到任何关于 protobuf 错误的信息。有人有什么建议吗?

注意:我尝试使用 Home-brew 安装 protobuf,但在 J2ObjC 安装期间似乎无法正常工作,它似乎无法找到 Protobuf 的根目录

标签: javamacosterminalinstallationprotocol-buffers

解决方案


我遇到了同样的问题并解决了。问题是 pkgconfig 受 mac 限制。因此,您需要禁用 csrutil,您可以在 Mac 恢复模式下执行此操作。

只需按照这些链接。

  1. https://apple.stackexchange.com/questions/208478/how-do-i-disable-system-integrity-protection-sip-aka-rootless-on-macos-os-x

这是为了禁用那个 csrutil。

  1. https://www.macworld.co.uk/how-to/mac-software/mac-recovery-mode-367​​4052/

这将指导您如何进入恢复模式。

它绝对有效。我通过解决这个问题设法安装了 protobuf。


推荐阅读