【问题标题】:Filesystem and locale文件系统和语言环境
【发布时间】:2013-04-05 20:40:55
【问题描述】:

我正在尝试构建使用带有 NDK 的 boost 文件系统的代码(适用于 android)。

除了文件系统,一切都很好:

libs/filesystem/src/path.cpp:911: error: undefined reference to 'std::locale::locale(char const*)'
libs/filesystem/src/path.cpp:911: error: undefined reference to 'std::locale::locale(char const*)'
libs/filesystem/src/path.cpp:911: error: undefined reference to 'std::locale::locale(char const*)'
libs/filesystem/src/path.cpp:911: error: undefined reference to 'std::locale::locale(char const*)'

911行代码:

static std::locale posix_lazy_initialization(path::imbue(std::locale("")));

任何想法如何解决这个问题?


当我将 STL 版本从:gnustl_static 更改为 gnustl_shared 时,问题消失了。会是什么?

【问题讨论】:

  • 我也面临这个问题,但是共享链接对我来说不是一个合适的解决方案!

标签: c++ android-ndk locale


【解决方案1】:

在第 906/907 行,他们有 MACRO

#if defined(BOOST_POSIX_API) && \
    !(defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__))

我更改为包含 ANDROID 的例外

#if defined(BOOST_POSIX_API) && \
    !(defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__) || defined(ANDROID))

到目前为止一切都很好,虽然我的代码不依赖于语言环境...

我已将这个问题交叉发布到 Android 开发者 Google 小组,所以也许他们会对为什么动态链接有效而不是静态链接有明确的答案。我会发布我得到的任何消息......

【讨论】:

  • 感谢您的回答;)如有任何消息,请在此处发布。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2013-06-14
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-01-06
  • 2019-11-21
相关资源
最近更新 更多