6

Brief account of the issue:

After installing curlpp, I attempted to compile c++ code which uses the curlpp library and got the following error:

g++ testCurl.cpp -lcurlpp
/usr/bin/ld: /tmp/ccx5aH5P.o: undefined reference to symbol 'curl_easy_setopt@@CURL_OPENSSL_3'
//usr/lib/x86_64-linux-gnu/libcurl.so.4: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

Any ideas how to fix this?

More detail:

I first attempted to install curlpp from source, but after running ./config, I was informed that I need boost (it's a new computer so I did not already have it installed). I installed boost. Then I was informed I needed "a working version of curl" or something like that. After a quick internet search, I found that I needed to install some version of libcurl-dev. In particular I installed the package: libcurl4-openssl-dev 7.35.0-1ubuntu2.2 After this, curlpp compiled and installed without issue.

Finally, I took some generic test code and attempted a compile using the command g++ test.cpp -lcurlpp. This led to the above error. I tried uninstalling curl and everything related and re-installing it. I also tried installing some of the alternate libcurl-dev implementations. Same error.

I have poked around the net for solutions and tried several other things. Nothing has worked so far.

Thanks in advance for any help!!

Craig S. Anderson
  • 6,150
  • 4
  • 27
  • 42
user2548343
  • 591
  • 4
  • 11

1 Answers1

13

I found the dumb fix. I'll leave this up in case someone else has the same issue. You must compile with: g++ file.cpp -lcurlpp -lcurl

user2548343
  • 591
  • 4
  • 11
  • Thanks, I had the same problem - with the [curl-cpp](https://github.com/JosephP91/curlcpp) library though - and couldn't think why it failed. I thought that linking the wrapper library libcurlcpp would indirectly link with libcurl as its dependency but that is not the case. – Elias Kouskoumvekakis Dec 27 '16 at 20:04