boost on Android using stlport

860 views Asked by At

In my Android App, I need to build both websocketpp (http://www.zaphoyd.com/websocketpp) and libjingle (https://code.google.com/p/libjingle/) and then I run into the following problem:

websocketpp is using the boost library (www.boost.org) which I can build fine with:

APP_STL         := gnustl_static

But with this setting when I link libjinge library, I got the error:

undefined reference to 'std::__node_alloc::_M_deallocate(void*, unsigned int)'

If I change to use stlport in Application.mk:

APP_STL         := stlport_static

Then I got error when compile websocketpp:

fatal error: array: No such file or directory

websocketpp include the array that I can only find here:

sources/cxx-stl/gnu-libstdc++/4.8/include/array

I can not link both stlport and gnustl libraries because I got error complaining about duplicate definitions.

So how can I solve this issue for my project that can use both tlport and gnustl?

[UPDATE]

It's definitely not possible to use both stlport and gnustl in the project, so I have to choose one. WebRTC is using stlport and gnustl is under GPL so stlport should be a better choice.

I am able to build the boost library (used by websocketpp) with some changes in file "boost/tools/build/v2/user-config.jam":

<compileflags>-I$(AndroidNDKRoot)/sources/cxx-stl/stlport/stlport
using stlport : android : $(AndroidNDKRoot)/sources/cxx-stl/stlport/stlport ;

And run bjam with stdlib=stlport-android option.

The compiling and linking is successful. However, when I run my app, it crashes when executing some code in the boost library.

Anybody has any luck on building and running boost library on Android using stlport?

0

There are 0 answers