gpt4 book ai didi

macos - 指定编译器 Homebrew 安装

转载 作者:行者123 更新时间:2023-12-02 10:49:47 26 4
gpt4 key购买 nike

我在尝试安装 mkvtoolnix 时遇到了障碍与 homebrew在 OSX 10.8

当我尝试 brew install mkvtoolnix我得到以下错误跟踪

checking for support for C++11 feature "nullptr"... yes
checking for support for C++11 feature "tuples"... yes
checking for support for C++11 feature "alias declarations"... yes
checking for support for C++14 feature "std::make_unique"... no
checking for support for C++14 feature "digit separators"... no
checking for support for C++14 feature "binary literals"... no
checking for support for C++14 feature "generic lambdas"... no
The following features of the C++11/C++14 standards are not supported by clang++:
* std::make_unique function (C++14)
* digit separators (C++14)
* binary literals (C++14)
* generic lambdas (C++14)
If you are using the GNU C compiler collection (gcc) then you need
at least v4.9.x.
configure: error: support for required C++11/C++14 features incomplete

这是有道理的,因为 clang++ 不支持 C++14 功能。此外,我已经安装了 GCC 5.2,因此可以使用 g++-5.2.0编译那些。

问题是在调用 brew install 时我还没有看到设置不同的编译器。

我已经尝试添加 cc , c++ , gccg++到 PATH 并将它们符号链接(symbolic link)到 usr/local/binusr/bin无济于事,总是求助于 clang++
如何指定 g++-5.2.0作为编译器?

最佳答案

您需要在安装命令中添加一个选项:

brew install --cc=gcc-5.2 mkvtoolnix

注意只允许使用受限的编译器列表( Homebrew 编译器)。您还应该检查是否安装了 gcc-5.2:
which gcc-5.2

关于macos - 指定编译器 Homebrew 安装,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41473478/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com