Best tutorial on using C++ code with iOS and Android
Please read this wonderful StackOverflow post:
First run 'curl-config --libs' to see if you have the library '-libcurl' search for the package: 'apt-cache search libcurl' install the package: 'sudo apt-get install libcurl4-nss-dev' check to see if you have the package againNext, go to http://curl.haxx.se/libcurl/c/simple.html. Copy and paste the code, save as 'simple.c' Change the "http://example.com" to something you want.
Compile your code: 'gcc simple.c -lcurl -o simple.out' Run the code: './simple.out' Output of (http://www.google.com/):
http://curl.haxx.se/libcurl/c/simple.html
'for' loop initial declarations are only allowed in C99 modeAfter a little bit of research, in Eclipse, go to Project > Properties > C/C++ Build > Settings > GCC C Compiler > Miscellaneous > add "-std=c99" to the "Linker Flags" text field.
http://www.eclipse.org/forums/index.php?t=msg&goto=212981&
undefined reference to `sqrt'After a little bit of research, in Eclipse, go to Project > Properties > C/C++ Build > Settings > GCC C Linker > Miscellaneous > add "-lm" to the "Linker Flags" text field. That way it is properly linked to the project.
http://cboard.cprogramming.com/c-programming/88943-undefined-reference-sqrt.html
#include <stdio.h> int main() { printf("Hello world!\n"); }