Saturday, 12 November 2016

c - Difference between curl/curl.h, libcurl, libcurl4-openssl-dev, libcurl4-nss-dev libraries?



i had the following curl headers, and i still could install the libcurl4 packages mentioned above-




kafka@metamorphosis:~$ ll /usr/include/curl/
total 200
drwxr-xr-x 2 root root 4096 Jan 16 13:29 ./
drwxr-xr-x 51 root root 20480 Jan 16 13:29 ../
-rw-r--r-- 1 root root 7303 Dec 18 01:11 curlbuild.h
-rw-r--r-- 1 root root 83928 Dec 18 01:11 curl.h
-rw-r--r-- 1 root root 8934 Dec 18 01:11 curlrules.h
-rw-r--r-- 1 root root 2741 Dec 18 01:11 curlver.h
-rw-r--r-- 1 root root 3472 Dec 18 01:11 easy.h
-rw-r--r-- 1 root root 2790 Dec 18 01:11 mprintf.h

-rw-r--r-- 1 root root 13836 Dec 18 01:11 multi.h
-rw-r--r-- 1 root root 1330 Dec 18 01:11 stdcheaders.h
-rw-r--r-- 1 root root 36918 Dec 18 01:11 typecheck-gcc.h


How are libcurl4-openssl-dev and libcurl4-nss-dev different from each other and from these curl.h files?



i noticed the following files after i installed the two packages using apt-get in ubuntu-



/usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.3

/usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4.3.0
/usr/lib/x86_64-linux-gnu/libcurl.so.4.3.0
/usr/lib/x86_64-linux-gnu/libcurl.so.4
/usr/lib/x86_64-linux-gnu/libcurl.la
/usr/lib/x86_64-linux-gnu/libcurl.so.3
/usr/lib/x86_64-linux-gnu/libcurl.a
/usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4
/usr/lib/x86_64-linux-gnu/libcurl.so
/usr/lib/x86_64-linux-gnu/pkgconfig/libcurl.pc



Now if i have a program with a line like- #include , how do i go about compiling it?



gcc -L /usr/include/curl/ -lcurl nginx-isolated.c doesn't seem to work.


Answer



The different libcurl4-*-dev packages are libcurl built to use different TLS backends. They all still provide (almost) the same API. They are mutually exclusive and you link with libcurl with "-lcurl" no matter which of these packages you install.



curl/curl.h is a header file and is the same no matter which TLS backend you use.



libcurl is the name of the library.



No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...