将 CLANG 构建的可执行文件与 G++-v6 构建的 Boost 库链接时出错

errors linking clang-built executable with g++-v6-built boost library

本文关键字:构建 链接 Boost 出错 CLANG 可执行文件 G++-v6      更新时间:2023-10-16

我在Fedora Linux上用g++版本6.3.1构建了一个增强正则表达式库。

然后我有自己的库,使用 boost 正则表达式,使用 clang++ 4.0 作为共享对象构建。构建这个工作正常。

最后,我有一个链接到我的库的可执行文件,这会产生以下错误:

undefined reference to `boost::re_detail::cpp_regex_traits_implementation<char>::transform[abi:cxx11](char const*, char const*) const'

使用 g++ 构建和链接只能正常工作。

这可以通过一些命令行参数来解决吗?

由于似乎没有人对此有解决方案,我第二次编译了 boost ./b2 工具集=clang现在我的问题消失了。