LibCurl: how do I compile the example code?
7,204
copy the source file to a directory where you have write permissions (so that the compiler is able to create the executable) e.g.
mkdir ~/src && cd ~/src cp /usr/share/doc/libcurl4-doc/examples/ftpget.c ./
compile and link the file using gcc
gcc -Wall -o ftpget ftpget.c -lcurl
This will create an executable called ftpget
which you should be able to run from the current directory using ./ftpget
Related videos on Youtube
![Admin](/assets/logo_square_200-5d0d61d6853298bd2a4fe063103715b4daf2819fc21225efa21dfb93e61952ea.png)
Author by
Admin
Updated on September 18, 2022Comments
-
Admin almost 2 years
I have install libcurl by running:
sudo apt-get install libcurl4-gnutls-dev
Now, the folder locates at my
/usr/share/doc/libcurl4-gnutls-dev/examples$
.Say I want to compile
ftpget.c
. How do I do that?