我正在尝试使用静态curlpp库在VS2008中构建C ++控制台应用程序。 代码 - 这是curlpp示例00 - 如下所示:
#include "stdafx.h"
#include <curlpp/curlpp.hpp>
#include <curlpp/Easy.hpp>
#include <curlpp/Options.hpp>
using namespace curlpp::options;
int main(int, char **)
{
try
{
// Our request to be sent.
curlpp::Easy myRequest;
// Set the URL.
myRequest.setOpt<Url>("http://example.com");
// Send request and get a result.
// By default the result goes to standard output.
myRequest.perform();
}
catch(curlpp::RuntimeError & e)
{
std::cout << e.what() << std::endl;
}
catch(curlpp::LogicError & e)
{
std::cout << e.what() << std::endl;
}
return 0;
}
我已经下载了源代码,并将我的包含路径指向了源代码中的包含文件,但是当我尝试编译时,在内联文件中出现了许多“definition of dllimport function not allowed”类型的错误。
肯定有很多人已经在vs2008中使用curlpp,而我缺少了一些显而易见的东西。