2

I'm trying to build code which uses boost filesystem with NDK (for android).

Everything is okay except the filesystem:

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*)'

The 911 line of code:

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

Any ideas how to fix this?


When I changed STL version from: gnustl_static to gnustl_shared problem disappeared. What could it be?

Max Frai
  • 61,946
  • 78
  • 197
  • 306
  • I am facing this as well, however shared linkage is not an appropriate solution for me! – yano Apr 11 '13 at 01:04

1 Answers1

3

On line 906/907, they have the MACRO

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

Which I changed to include an exception for ANDROID

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

So far so good, though my code does not rely on locales...

I have cross posted this question to the Android Developers Google Group, so maybe they will have a definitive answer on why dynamic linking works instead of static. I will post any news I get...

yano
  • 4,095
  • 3
  • 35
  • 68