views:

98

answers:

0

How can I use Curlpp (or clean CURL)?
Now, I'm trying to do few basic actions (for example use POST) and I can't compile my project (now, I am using Windows, mingw, code::blocks).

I have added library, my IDE see this library. I heard about problems with curl+mingw+code::block.
Solution is using definition #define STDC_HEADRES 1 in curlpp/config.win32.h but it doesn't work.

Included examples doesn't work:

#include <iostream>

#include <curlpp/cURLpp.hpp>
#include <curlpp/Easy.hpp>
#include <curlpp/Options.hpp>

int main()
{
    std::cout << "Hello World" << std::endl;

    curlpp::Cleanup myCleanup;
    // Creation of the URL option.
    curlpp::options::Url myUrl(std::string("http://example.com"));

    return EXIT_SUCCESS;
}

errors:

||=== curl, Debug ===|
obj\Debug\main.o||In function `main':|
\curl\main.cpp|11|undefined reference to `__imp___ZN6curlpp7CleanupC1Ev'|
\curl\main.cpp|15|undefined reference to `__imp___ZN6curlpp7CleanupD1Ev'|
\curl\main.cpp|15|undefined reference to `__imp___ZN6curlpp7CleanupD1Ev'|
obj\Debug\main.o||In function `_ZN6curlpp8internal15OptionContainerISsE8getValueEv':|
::~Option()]+0x8c)||undefined reference to `__imp___ZN6curlpp10OptionBaseD2Ev'|
::~Option()]+0xb8)||undefined reference to `__imp___ZN6curlpp10OptionBaseD2Ev'|
)]+0x43)||undefined reference to `__imp___ZN6curlpp10OptionBaseC2E10CURLoption'|
)]+0x94)||undefined reference to `__imp___ZN6curlpp10OptionBaseD2Ev'|
]+0x10)||undefined reference to `curlpp::OptionBase::operator<(curlpp::OptionBase const&) const'|
]+0x10)||undefined reference to `curlpp::OptionBase::operator<(curlpp::OptionBase const&) const'|
::~Option()]+0x8c)||undefined reference to `__imp___ZN6curlpp10OptionBaseD2Ev'|
::~Option()]+0xb8)||undefined reference to `__imp___ZN6curlpp10OptionBaseD2Ev'|
::~Option()]+0x8c)||undefined reference to `__imp___ZN6curlpp10OptionBaseD2Ev'|
::~Option()]+0xb8)||undefined reference to `__imp___ZN6curlpp10OptionBaseD2Ev'|
)]+0x97)||undefined reference to `__imp___ZN6curlpp11UnsetOptionC1EPKc'|
\curl\.\curlpp\internal\OptionSetter.inl:(.text$_ZN6curlpp11UnsetOptionD1Ev[curlpp::UnsetOption::~UnsetOption()]+0x16)||undefined reference to `__imp___ZN6curlpp12RuntimeErrorD2Ev'|
) const]+0x94)||undefined reference to `__imp___ZN6curlpp11UnsetOptionC1ERKSs'|
::getValue() const]+0x94)||undefined reference to `__imp___ZN6curlpp11UnsetOptionC1ERKSs'|
)]+0x1e)||undefined reference to `__imp__curl_easy_setopt'|
)]+0x38)||undefined reference to `__imp___ZN6curlpp20libcurlRuntimeAssertEPKc8CURLcode'|
\curl\.\curlpp\internal\OptionSetter.inl:(.text$_ZN6curlpp11UnsetOptionD0Ev[curlpp::UnsetOption::~UnsetOption()]+0x16)||undefined reference to `__imp___ZN6curlpp12RuntimeErrorD2Ev'|
||=== Build finished: 20 errors, 0 warnings ===|