用macports构建boost后找不到.a静态库文件,我只有dylib

Cannot find .a static library files after building boost with macports, I only have dylib

本文关键字:文件 dylib 静态 构建 macports boost 找不到      更新时间:2023-10-16

使用Xcode 7.1…

使用命令sudo port install boost +universal 构建

我的印象是,如果我想分发我的软件,每个用户都需要.dlib文件,因为dylib是一个动态库,而.a将静态链接,因此它将嵌入最终产品中。这是真的吗?如果是,如何获取.a文件?

我正在尝试使用regex和文件系统库。

有一个默认启用的MacPorts变体"no_static"。要为boost构建静态库,请使用(假设您仍然需要通用二进制)

sudo port install boost +universal -no_static

我在做后很容易就发现了这一点

port info boost
port variants boost

是的,您需要.a文件。用啤酒代替。

brew install boost --universal