簡體   English   中英

指定編譯器 Homebrew 安裝

[英]Specify compiler Homebrew install

我在 OSX 10.8 上嘗試使用homebrew安裝mkvtoolnix時遇到了障礙

當我嘗試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時設置不同的編譯器

我已經嘗試將ccc++gccg++到 PATH 並將它們符號鏈接到usr/local/binusr/bin無濟於事,它總是clang++

如何將g++-5.2.0指定為編譯器?

您需要在安裝命令中添加一個選項:

brew install --cc=gcc-5.2 mkvtoolnix

請注意,僅允許使用受限的編譯器列表(自制編譯器)。 您還應該檢查是否已安裝gcc-5.2:

which gcc-5.2

對於較新版本的 Homebrew,它現在支持使用HOMEBREW_CCHOMEBREW_CXX環境變量。 有關詳細信息,請參閱此 SO 帖子

暫無
暫無

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

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