Search code examples
c++libcurlbuilding

Building libcurl library in c++, Noob Question


I wanna write a little c++ program using libcurl. It's for a school project so I need to be able to package everything in a zip file and email it to my instructor. I've just downloaded the tar from the libcurl website but now I'm not sure what the next step is... What else do I gotta do in order to be able to do #include "curl/curl.h" and call curl functions from my main function? Once I do that how would I zip it and make sure my instructor will be able to compile it too? I'm using Ubuntu. Any help will be apprecitated!


Solution

  • 1) Download the source from here.

    2) unpack with "tar xvzf tarfilename"

    3) cd to newly created directory from the unpack

    4) enter "./configure"

    5) enter "make" and "make install"

    6) write your program and remember to link against the library.

    7) When ready to send to prof, I would zip the original libcurl source along with the instructions above and any other you used to get your project to work.

    Edit - Something like:

    g++ -g -Wall -o myapp myapp.cpp -L/usr/local/lib -lcurl