【问题标题】:Statically Linked Boost Regex Not Working静态链接的 Boost 正则表达式不起作用
【发布时间】:2013-10-15 19:25:49
【问题描述】:

我正在尝试静态链接到 boost 正则表达式库。我正在使用最新版本的 boost (1.54),但我似乎无法让它工作。我尝试通过首先运行 bootstrap.sh,然后运行 ​​b2 link=static 来编译库。

在编译我的程序时,我使用编译器标志 -I/path/to/boost,并将 /path/to/boost/lib/libboost_regex.a 添加为我的链接器对象之一。调用 boost::regex 方法不能按预期工作,例如 boost::regex_search。

我已经确认当我动态链接到 boost 库时我的代码可以正常工作。静态链接时是否需要执行某种初始化?

【问题讨论】:

标签: c++ static-linking boost-regex


【解决方案1】:

我一定是做错了什么。将 libboost_regex.a 添加到我的链接器对象列表中似乎可以正常工作。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-07-09
    • 2011-06-26
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多