c++eclipsemacoshomebrewcurlpp

Issues using curlpp after OSX homebrew install


I want to use curl/curlpp in my C++ project so I used the commands:

brew install curl and brew install curlpp

which had no issues. So to check that they were installed properly I called:

curl --version and curlpp --version

The first command gave a response, but the second issues the error:

curlpp: command not found

This is odd as if I check the directory usr/local/Cellar I can see that both curl and curlpp are there. On top of this when I add curl and curlpp to my linker in Eclipse project properties, I am unable to compile when I include curlpp/cURLpp.hpp, but curl/curl.h causes no issue.

If someone could help me with this that would be awesome, as I am a total noob when it comes to using foreign libraries in a C++ project.


Solution

  • First, you don't need to install curl by yourself because macOS already have one.

    Second, C++ libraries generally don't have executable.
    So, curlpp doesn't exist.

    Finally, if you want to external library, you have to tell compiler where the library is.
    C++ library generally have a script to do that, <library name>-config.
    In the case of curlpp, curlpp-config is the one.

    You can pass curlpp-config --cflags --libs to your compiler to tell it about the library.