我正在使用OpenCV在C上创建一个库,并尝试为Android编译它.
我不能使用to_string(int)但我不能.我试图修改我的makefile太多次了.我的最后一个配置就是:
Android.mk
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
OPENCV_CAMERA_MODULES:=off
OPENCV_INSTALL_MODULES:=on
include $(LOCAL_PATH)/jsoncpp/Android.mk
include /Users/rafaelruizmunoz/Desktop/AndroidDevelopment/OpenCV-2.4.9-android-
sdk/sdk/native/jni/OpenCV.mkOPENCV_LIB_TYPE:=SHARED
LOCAL_C_INCLUDES += $(LOCAL_PATH)
LOCAL_C_INCLUDES += /Users/rafaelruizmunoz/opencvscan/OpenCVtry/
LOCAL_C_INCLUDES += /Users/rafaelruizmunoz/Desktop/RD/OpenCVtry/Libraries/jsoncpp-
master/includeLOCAL_PATH := jni
LOCAL_ALLOW_UNDEFINED_SYMBOLS := true
LOCAL_MODULE := libXYZ
LOCAL_MODULE_NAME := mylibXYZ
LOCAL_SRC_FILES := androidClass.cpp main.cpp utils.cpp
LOCAL_LDLIBS += -llog -ldl
LOCAL_CPPFLAGS := -std=c++11 CFLAGS=-g -Wall -Wextra -std=c++11 -Wno-write-strings
../../include/boostLOCAL_SHARED_LIBRARIES := libJsoncpp libopencv_java
include $(BUILD_SHARED_LIBRARY)
这是我的Application.mk
APP_STL := gnustl_static
APP_CPPFLAGS := -frtti -fexceptions
APP_ABI := all
APP_MODULES := libXYZ libJsoncpp
APP_CPPFLAGS := -std=gnu++0x
APP_CPPFLAGS += -frtti
APP_CPPFLAGS += -fexceptions
APP_CPPFLAGS += -DDEBUG
APP_CPPFLAGS += -std=c++11
NDK_TOOLCHAIN_VERSION := 4.8
LOCAL_C_INCLUDES += ${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++/4.8/include
APP_USE_CPP0X := true
提前致谢.
解决方法
APP_CPPFLAGS := -std=c++11
和
APP_STL:=c++_static
要么
APP_STL:=c++_shared