Take the 2-minute tour ×

I'm newbie to c++, and I'm using mingw compiler. the last line

#include <curlpp/cURLpp.hpp>
#include <curlpp/Easy.hpp>
#include <curlpp/Options.hpp>
string url ("http://www.google.com");
curlpp::Cleanup myCleanup;
curlpp::options::Url myUrl(url);

throws the following long error while compilation

TraitISsL10CURLoption10002EED1Ev[curlpp::OptionTrait<std::basic_string<char, std
::char_traits<char>, std::allocator<char> >, (CURLoption)10002>::~OptionTrait()]
+0xb): undefined reference to `_imp___ZTVN6curlpp11OptionTraitISsL10CURLoption10

What's wrong here? Do I need to do something more then copying include folders from curlpp and libcurl to use curlpp?

Thank you in advance!

share|improve this question

2 Answers 2

up vote 2 down vote accepted

This is a linker error.

You need to add the libcurl libraries to the build command. Something like:

g++ test.cpp -o test -llibcurlpp

I am not sure of the exact name of the libcurl library.

share|improve this answer
better -lcurlpp –  Benoit Dec 12 '11 at 13:44
mingw says that he cannot find -lcurlpp, the same for -llibcurlpp. I'm building with g++ test.cpp -I include -o test -lcurlpp –  Eugeny89 Dec 12 '11 at 14:53
where are the curl lib files installed? Add "-L<curl-lib-dir>": g++ test.cpp -I include -L /path/to/curl/lib/dir -o test -lcurlpp –  hmjd Dec 12 '11 at 14:56
I'd puted curlpp folder in the same folder where test.cpp is. After adding -L curlpp got the same error –  Eugeny89 Dec 12 '11 at 15:08
try specifying full path to the directory that holds the lib files. –  hmjd Dec 12 '11 at 15:13

In your curlpp distribution (.tar.gz file, usually) you can find all the documentation you need. Basically, you may want to take a look at README, doc\guide.pdf and include\curlpp\ directory for class/function definitions.

If you don't have any of these, make sure you get the latest sources, as today.

Hope it helps.

share|improve this answer

Your Answer


