一、cocos2d-x 3.0 final使用httpclient编译到android,须要用到的android.mk

今天写一个网络框架,在vs上面非常欢快的执行车,心想,尼玛!cocos2d-x 3.0这么方便,预计不久的将来我就能回家种地了,由于不用程序猿了,直接cocos2dstudio拖界面了= =!!。

写好windows上的,这不想作一下,编译到android平台给同事看看。cocos run -p android,突然httpClient::getInstance undefined,知道那种妹子已经铺好床等你,可是你裤绳打结的心情吗。。!并且网上也没什么好的解决方式,最后自己捉摸捉摸,是由于httpclient没有编译,于是有例如以下android.mk

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE := cocos2dcpp_shared

LOCAL_MODULE_FILENAME := libcocos2dcpp

FILE_LIST := hellocpp/main.cpp
FILE_LIST += $(wildcard $(LOCAL_PATH)/../../Classes/*.cpp)
#编译network里面的httpClient.cpp和socketIo.cpp
FILE_LIST += $(wildcard $(LOCAL_PATH)/../../../../cocos/network/*.cpp)
LOCAL_SRC_FILES := $(FILE_LIST:$(LOCAL_PATH)/%=%)
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocosdenshion_static
LOCAL_WHOLE_STATIC_LIBRARIES += box2d_static
#curl static
LOCAL_WHOLE_STATIC_LIBRARIES += cocos_curl_static
#socket static
LOCAL_WHOLE_STATIC_LIBRARIES += libwebsockets_static
include $(BUILD_SHARED_LIBRARY)
$(call import-module,2d)
$(call import-module,audio/android)
$(call import-module,Box2D)
#加入network支持
$(call import-module,network)
$(call import-module,../extensions)
#加入curl库的支持
$(call import-module,curl/prebuilt/android)
#加入websocket支持
$(call import-module,websockets/prebuilt/android)
上一篇:5.Mybatis的输出映射(就是对查询的结果集的映射)


下一篇:ffmpeg(2.6) rockplayer android 下编译 小记.