0

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.

L-S
  • 107
  • 7

2 Answers2

1

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.

equal-l2
  • 899
  • 7
  • 17
  • Thanks so much! I realized that I had to pass the command you mentioned in your last sentence in order for the libraries and includes to be placed in `/usr/local/`. Also for anyone who has this same issue with Eclipse, I realized I need to do two things: 1. Go to **Properties->C/C++ Build->Cross G++ Compiler->Includes** and add the path to my include folder aka `/usr/local/include` for me 2. Go to **Properties->C/C++ Build->Cross G++ Linker->Libraries** and add the library `curlpp` as well as the search path `/usr/local/lib` aka where my libcurlpp.a file was located – L-S Jan 27 '17 at 16:45
1

You can check installed package versions in Brew with these commands:

brew list --versions
brew cask list --versions
balazs630
  • 3,421
  • 29
  • 46