Hello,
I need help to build with curl for android in cocos2d-x v3.9
I got this error:
[armeabi] Compile++ thumb: cocos2dcpp_shared <= ServerSide.cpp
jni/../../../Classes/ServerSide.cpp:10:23: fatal error: curl/curl.h: No such file or directory
#include <curl/curl.h>
^
compilation terminated.
I tried to add
$(call import-module,curl/prebuilt/android/armeabi)
to Android.mk but it didn’t work.
YourProject\frameworks\cocos2d-x\cocos\Android.mk, you can see whether you include
$(call import-module,curl/prebuilt/android)
This may be the problem.
I’ve uncommented that out, I’ve tried adding libcurl to LOCAL_SHARED_LIBRARIES in my own Android.mk too but that didn’t work either.
This is the commit in cocos that commented the line out, but I don’t see anything to undo that and have curl be usable on android.
Besides making sure that line is enabled in cocos’ Android.mk, is there other steps to get this working?
edit: I didn’t realize there was a curl Android.mk file, I found the name of that module, and included it in my own Android.mk:
LOCAL_STATIC_LIBRARIES += cocos_curl_static
Also not sure if this was necessary or not, but I also added this line to my SHARED_LIBs (I was trying this out before the module name, but I’m not going to wait 10 minutes to recompile again to check haha)
LOCAL_SHARED_LIBRARIES += libcurl
Hope this helps!