There is no problem in Xcode, but in Eclipse there is unfortunately.
I did this in 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)
I put the curl folder in Classes. I then included it in GameplayLayer.cpp.
No errors occur if I use
CURL *curl;
CURLcode res;
But as soon as I put
curl = curl_easy_init();
I get an error,
make: *** [obj/local/armeabi/libgame.so] Error 1
Please help, I would gladly give one of my kidneys in exchange for getting this %&#@ to work.
I’m getting:
undefined reference to `curl_easy_init'
I added this line in Android.mk to make it work.
Of course in order to connect to the internet you will also need to edit AndroidManifest.mk and add this line: