`Damien, in Xcode just add the header files folder to the frameworks. Click on the project in the left panel then scroll down to frameworks and add the folder.
`小 苏,
I did this in Eclipse:
Go to project properties
C/C++ General
Paths and Symbols
Then added everything I could get my hands on everywhere. I included the libcurl folder in all ‘Include’, ‘Lobrary Paths’ and ‘Source Location’. I then added the three libcrul.a files under ‘Libraries’.
That’s good that you succeeded to do it.
I hope to do it too.
For the moment I’m still in xcode . I add the last version 7.26.0 and just rename the folder to “curl”.
I added it as a group in xcode and when I compile, I need openssl and more.
So I remove the example folder.
After, when I compile, I have a redefinition of the strut timeval.
As it’s already created in platform.h of cocos2-x I remove it, but I now have this error :
Expected * before *
Expected '=', ',', ';', 'asm' or '__attribute__' before 'Missing_definition_of_macro_sread'
Let me see, drag/drop both ‘curl’ and ‘libraries’ folders into the ‘Frameworks’ folder. Don’t rename anything inside Xcode. Also click on the target, go to Build phases, and drag/drop all curl header files inside ‘Compile Sources’. Then just to make sure, click on the ‘Summary’ tab then scroll down and add ‘libcurl.a’ to the frameworks. Also have another ‘curl’ folder inside ‘Classes’ and don’t forget the ’#include “curl.h”.
Hum I was forgetting libcurl.a
As I was looking everywhere to find some clues, I find that cocos2d-x already give include and libcurl.a
I added the include in classes and the libcurl.a in frameworks, and you three lines compile very fine.
I will play with it now
And to don’t stop after that, I will try directly on Android.
As I’m not that familiar in android I hope it won’t be that hard.
I will follow your steps.
Resources on Cocos2d-x are very scarce on the web. But I have a gem for you - the tests project. This is how I solved my problem. Run the tests program and view how everything is programmed and you will become an expert in Cocos2d-x!
So be sure to try that.
Regarding Android development, it’s not hard. Eclipse is crap compared to Xcode (or maybe it’s just me) but once get the setup complete it will feel as if you’re programming for iOS, no difference.
I play a bit in iOS with libcrul and it’s exactly that I need.
So to continue to debug on both iOS and Android, I still try to compile on Android.
I do both of your thread, my android.mk are same (just some lines less) and I update my manifest.
But when I do “./build_native.sh” I still got errors.
The first one is :
jni/…/…/Classes/MenuScene.cpp:3:18: error: curl.h: No such file or directory
Do you have add something else, maybe something that you don’t tell as it’s an evidence.
I’m sorry to ask you for something maybe that simple, but I really don’t see what to do to success.
You need to also add all the curl files in the classes folder. Make sure there is a Classes folder and in it a curl folder and in it all the header files. Then make sure that on top of curl.h there is something like ‘#ifndefCURL_CURL_H #defineCURL_CURL_H’ where the first curl is the folder and the second the file itself. Then in your code include curl/curl.h.