3

以下代码:

#include <boost/locale.hpp>
int main()
{
    using namespace boost::locale;
    generator gen;
}

使用以下标志构建:

g++ -static -static-libstdc++ -pthread main.cpp -lboost_locale -lboost_system -licuuc -licudata -licui18n

链接失败,出现以下错误:

(.text+0x16b8): undefined reference to `icu_60::CacheKeyBase::~CacheKeyBase()'
(.text+0x1c8d): undefined reference to `icu_60::UVector64::~UVector64()'
(.text+0x7dc): undefined reference to `icu_60::UCharsTrie::Iterator::~Iterator()'
...hundreds of other undefined symbols
...(the sample code also has boost linking errors, but let's ignore them, as they only appear in my attempt of reproduction; the real code I have issues with has only icu-related link errors)

我正在使用 Ubuntu 18.04,两者都libboost-all-dev安装libicu-dev在 Ubuntu 存储库中。我可能缺少使其链接在一起所需的一些琐碎的组件/标志/库,但我无法找到它。

4

0 回答 0