在 Xcode 中没有问题,但在 Eclipse 中不幸的是。
我在 Android.mk 中做了这个:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := game
LOCAL_MODULE_FILENAME := libgame
LOCAL_SRC_FILES := helloworld/main.cpp \
../../Classes/AppDelegate.cpp \
../../Classes/HelloWorldScene.cpp\
../../Classes/GameplayLayer.cpp\
../../Classes/swimmerc.cpp\
../../Classes/pugixml.cpp
LOCAL_C_INCLUDES := ../../libs/cocos2dx \
../../libs/cocos2dx/platform \
../../libs/cocos2dx/include \
../../libs/CocosDenshion/include \
$(LOCAL_PATH)/../../Classes/\
LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static cocosdenshion_static curl_static
include $(BUILD_SHARED_LIBRARY)
$(call import-module,cocos2dx)
$(call import-module,cocos2dx/platform/third_party/android/prebuilt/libcurl)
$(call import-module,CocosDenshion/android)
我把curl
文件夹放在 Classes 中。然后我将它包含在GameplayLayer.cpp
. 如果我使用不会发生错误
CURL *curl;
CURLcode res;
但只要我放
curl = curl_easy_init();
我得到一个错误,
make: *** [obj/local/armeabi/libgame.so] Error 1
请帮忙,我很乐意捐出我的一个肾脏来换取这个 %&#@ 的工作。
我越来越:
undefined reference to `curl_easy_init'