简体   繁体   中英

How to compile curlpp on ubuntu?

Below is a simple test.c code using curl:

#include <stdio.h>
#include <curl/curl.h>
int main(){        
    return 0;
}

To compile this code I use:

gcc test1.c -lcurl -o test1

For test1.c above compilation is correct. Now I would like to write some code using C++ libs (curlpp) and after that compile it.

#include <iostream>
#include <curlpp/cURLpp.hpp>
#include <curlpp/Easy.hpp>
#include <curlpp/Options.hpp>
int main(){
    return 0;
}

To compile this code I tried:

g++ test2.cpp -lcurl -o test2

But I get this error:

fatal error: curlpp/cURLpp.hpp no such file or directory
compilation terminated.

This formula is not correct. The question is how to compile second code - test2.cpp?

You most likely forgot to install libcurlpp-dev .

You can find out where the required header files are located by running:

$ dpkg -S cURLpp.hpp
libcurlpp-dev:amd64: /usr/include/curlpp/cURLpp.hpp

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM