首先下載iconv文件 下載地址:http://download.csdn.net/detail/dingkun520wy/6703113android
把解壓後的iconv文件夾放到cocos2dx的同級目錄下spa
修改項目的proj.android/jni文件夾下的Android.mk文件.net
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../../iconv/include \
$(LOCAL_PATH)/../../../iconv/libcharset \
$(LOCAL_PATH)/../../../iconv/lib \
$(LOCAL_PATH)/../../../iconv/libcharset/include \
$(LOCAL_PATH)/../../../iconv/srclib \
$(LOCAL_PATH)/../../../iconv
LOCAL_WHOLE_STATIC_LIBRARIES += libiconv
$(call import-module,iconv)
get
在使用的類中導入頭文件(這個類要在Classes文件夾下)it
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)import
#include "../../../iconv/include/iconv.h"module
#endifcli
這樣就能夠調用iconv庫的方法了配置
比較容易出錯的是路徑的配置 下載