8

I am trying to use libcurl in a c++ program on a Raspberry Pi running GNU/Linux Debian Stretch.

To find all installed curl packages:

dpkg-query -l curl | grep '^.i'

which returns

curl

libcurl3:armhf

libcurl3-gnutls:arm

Running

curl-config --cflags

returns that there is no such command. A program with a declaration:

#include "curl/curl.h"

and compiling and linking with

g++ -o test test.cpp -lcurl

returns that there is no such "curl/curl.h" file. All the tutorials claim that curl-config is installed with curl. I didn't install curl; it is included in the distribution. Running the command

curl -I http://www.any_site.com

returns correct data.

1 Answer 1

11

You need to install the package libcurl-dev for development. (Or as of 2023, it may be libcurl4-openssl-dev.)

From packages.debian.org

Virtual Package: libcurl-dev

This is a virtual package. See the Debian policy for a definition of virtual packages.

Packages providing libcurl-dev

libcurl4-gnutls-dev

development files and documentation for libcurl (GnuTLS flavour)

libcurl4-nss-dev

development files and documentation for libcurl (NSS flavour)

libcurl4-openssl-dev

development files and documentation for libcurl (OpenSSL flavour)

2
  • What is the difference between these different "flavors" of libcurl? As a hello_world.c developer, how would I be impacted if I chose one flavor instead of another? For discussions' sake, say that I am only interested in very simple use of libcurl, e.g. I am expecting to only use curl_easy_setopt() and curl_easy_perform().
    – StoneThrow
    Feb 14 at 16:55
  • @StoneThrow I would advise a new question, and I suspect it to be more the domain of StackOverlow, which is more oriented towards development issues. Feb 22 at 12:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .