3
I’m testing the curlPP library and wrote the following program:
#include <iostream>
#include <curlpp/cURLpp.hpp>
#include <curlpp/Easy.hpp>
#include <curlpp/Options.hpp>
#include <sstream>
using namespace std;
using namespace curlpp::options;
int main(int argc, char** argv)
{
curlpp::Cleanup myCleanup;
std::cout << curlpp::options::Url("http://wikipedia.org");
std::ostringstream os;
os << curlpp::options::Url("http://wikipedia.org");
return 0;
}
And compiling with the following command:
g++ -o http_get httpreq.cpp -lcurlpp
Yet I get:
/usr/bin/ld: /tmp/ccSQpqLj.o: undefined reference to symbol 'curl_easy_setopt@@CURL_GNUTLS_3'
//usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
Any idea how to solve the problem?
Thanks! The way it is there did not compile, but I changed the flags of Linker of place, getting
g++ -o http_get httpreq.cpp -lcurlpp -lcurl
and it worked.– Borda
Strange, I compile in the order I have in the answer and it works well. Anyway, I’m glad it worked!
– bruno