6

I am developing a library for Android which has both Java and Native components. The Native library depends on the GNU STL. I was linking against gnustl_static, but have ran into a few strange problems that were resolved by linking gnustl_shared. (for example the question Filesystem and locale). For the time being, I have settled on gnustl_shared.

Here's where the question is -- the consumer of my library is expected to link against the Native .so to add code of their own. I understand from reading that all the C-runtimes must match.

  1. Demanding my clients use gnustl_shared seems like it might not work (as far as diplomacy and ease of integration goes)
  2. If I build with gnustl_shared, the JAR file generated contains libgnustl_shared.so, which causes a problem building an APK which also relies on this library. -- I suppose I can just not include it in the JAR file?
  3. If I build against gnustl_static do I avoid all these problems?
  4. If my API contains refernces to STL objects (mostly std::string and std::vector), will I face problems if my clients do not use GNU STL?

thanks

Community
  • 1
  • 1
yano
  • 4,095
  • 3
  • 35
  • 68

0 Answers0