C++ 在 mac 上使用 macport 安装时,boost 库的默认位置是什么?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/16127060/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-27 20:05:28  来源:igfitidea点击:

what is the default location for boost library when installed using macport on mac ?

c++macosboostmacports

提问by maditya

I just now installed boost on mac, using macport with following command

我刚刚在 mac 上安装了 boost,使用 macport 和以下命令

sudo port install boost

It's installed fine, but I have no idea where the boost library got installed to.
Where should it be / how could I search for it?

它安装得很好,但我不知道 boost 库安装在哪里。
它应该在哪里/我如何搜索它?

回答by maditya

The headers should be in /usr/local/include/boostand the libs should be in /usr/local/lib.Or in /opt/local/include/boostand /opt/local/lib, I believe.

我相信标题应该在/usr/local/include/boost,库应该在/usr/local/lib.或在/opt/local/include/boostand 中/opt/local/lib

You can search using locate:

您可以使用locate以下方法进行搜索:

locate boost

回答by Delta_Fore

Default is /usr/local/lib /usr/local/include

默认为 /usr/local/lib /usr/local/include

You might want to rebuild the libs using the clang toolchain

您可能想使用 clang 工具链重建库

./bjam toolset=clang

and then do a manual install in a specific location especially if you want to switch between versions (for source control or testing etc)

然后在特定位置进行手动安装,特别是如果您想在版本之间切换(用于源代码控制或测试等)

> find . -name boost

also works

也有效

回答by biohzd

For me, with High Sierra and MacPorts 2.4.4, MacPorts installed Boost 1.66 under:

对我来说,使用 High Sierra 和 MacPorts 2.4.4,MacPorts 在以下位置安装了 Boost 1.66:

/opt/local/include/boost

回答by Chidi

Using the macOS Sierra 10.13.5, installed boostwith brew. location in /usr/local/include/

使用macOS Sierra 10.13.5boostbrew. 位置在/usr/local/include/