[英]configure: error: C++ compiler cannot create executables on macOS
[英]install protobuf on MacOS 12.0.1 error: C compiler cannot create executables
我正在尝试使用以下说明安装protobuf
: https ://github.com/protocolbuffers/protobuf
但是,当我在本地 MacOS 上安装 C++ 运行本地./configure
文件时
q@Q-336-MacBook-Pro:~/Downloads/protobuf-3.21.1> gcc --version
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/usr/include/c++/4.2.1
Apple clang version 13.0.0 (clang-1300.0.27.3)
Target: x86_64-apple-darwin21.2.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
我得到错误
q@Q-336-MacBook-Pro:~/Downloads/protobuf-3.21.1> ./configure
checking whether to enable maintainer-specific portions of Makefiles... yes
checking build system type... x86_64-apple-darwin21.2.0
checking host system type... x86_64-apple-darwin21.2.0
checking target system type... x86_64-apple-darwin21.2.0
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a race-free mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether UID '501' is supported by ustar format... yes
checking whether GID '20' is supported by ustar format... yes
checking how to create a ustar tar archive... gnutar
checking whether make supports nested variables... (cached) yes
checking for gcc... /usr/local/opt/llvm/bin/clang
checking whether the C compiler works... no
configure: error: in `/Users/qliu/Downloads/protobuf-3.21.1':
configure: error: C compiler cannot create executables
See `config.log' for more details
brew install protobuf
这就是所有需要的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.