Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NDK do not find the standard C++ libraries

I'm trying to compile a native program for android.

But when runnning the ndk-build command I got the following result.

/home/marcos/dev/workspace/rmsdk.native.wraper/jni/include-all/uft_alloc.h:26:21: error: stdexcept: No such file or directory
/home/marcos/dev/workspace/rmsdk.native.wraper/jni/include-all/uft_alloc.h:27:18: error: limits: No such file or directory

stdexcept and limits are part of the std C++ lib.

This is my Android.mk

LOCAL_PATH := $(call my-dir)
MY_PATH := $(LOCAL_PATH)
include $(call all-subdir-makefiles)
LOCAL_PATH := $(MY_PATH)
include $(CLEAR_VARS)

LOCAL_LDLIBS := -llog
LOCAL_MODULE    := rmsdk
LOCAL_SRC_FILES := curlnetprovider.cpp RMServices.cpp  
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include-all
LOCAL_STATIC_LIBRARIES := adept cryptopenssl curl dp expat fonts hobbes jpeg mschema png t3 xml zlib

include $(BUILD_SHARED_LIBRARY)

I should explicit tell that it's a C++ source?

like image 215
Marcos Vasconcelos Avatar asked Jan 06 '11 16:01

Marcos Vasconcelos


1 Answers

In Application.mk (if it doesn't exist, create it) add the following line:

APP_STL := stlport_static

You will now be able to use the STL.

like image 168
Mark Ingram Avatar answered Oct 01 '22 12:10

Mark Ingram