我正在尝试使用静态 curlpp 库在 VS2008 中构建 C++ 控制台应用程序。代码 - curlpp example 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;
}
我已经下载了源代码并让我的包含路径指向了源包含文件,但是当我尝试编译时,我在以下类型的内联文件中得到了一大堆错误:
不允许定义 dllimport 函数
肯定有很多人在 vs2008 中使用过 curlpp,但我遗漏了一些明显的东西。