开发者

Using stl_tree.h on Android NDK results in "No such file or directory"

I'm porting a native library to a NDK application.

When I try to use the stl_tree.h #include, I got the following error.

error: stl_tree.h: No such file or directory

This is my Android.mk file.

LOCAL_PATH := $(call my-dir)
MY_PATH := $(LOCAL_PATH)
include $(call all-subdir-makefiles)
LOCAL_PATH := $(MY_PATH开发者_运维百科)
include $(CLEAR_VARS)
LOCAL_LDLIBS := -llog -la -lb -lc -lstdc++ -lgcc #I try to explicit declare the stdc++ and gcc but still doesn't works.
LOCAL_MODULE    := rmsdk
LOCAL_SRC_FILES := curlnetprovider.cpp RMServices.cpp
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include-all \
$(LOCAL_PATH)/include-all/openssl
LOCAL_STATIC_LIBRARIES := adept cryptopenssl curl dp expat fonts hobbes jpeg mschema png t3 xml zlib

include $(BUILD_SHARED_LIBRARY)

And this is my Application.mk

APP_MODULES := adept cryptopenssl curl dp expat fonts hobbes jpeg mschema png t3 xml zlib rmsdk
APP_STL := stlport_static

My actual problem is, when compiling I get a: '_Rb_tree_increment' is not a member of 'std' This is why I try to include the stl_tree myself. It appears this lib don't get included.


I can only speak for C++, not for android, but why are you trying to include stl_tree.h directly? You should include either <map> or <set> to get the actual container you want to use. In g++ anyway stl_tree.h is just a private implementation used by map and set.


I solved it using the stlport from NDK 5.


The Android NDK doesn't have the STL (or at least, it didn't the last time I looked at the SDK, which was on Froyo).

The reason why it doesn't have the STL is that by default everything is compiled with exceptions disabled. So be very, very careful when using third-party STL ports; there's a good chance that if anything goes wrong it'll just crash.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜