使用url编译错误
compile error with urdl
我下载了http库urdl,试图从文档(http://think-async.com/Urdl/doc/html/urdl/getting_started/setting_options_to_perform_an_http_post.html):
)编译示例。#define URDL_HEADER_ONLY 1
#include <boost/array.hpp>
#include <urdl/http.hpp>
#include <urdl/istream.hpp>
int main() {
urdl::istream is;
is.set_option(urdl::http::request_method("POST"));
is.set_option(urdl::http::request_content_type("text/plain"));
is.set_option(urdl::http::request_content("Hello, world!"));
is.open("http://somehost/path");
}
编译错误:
g:boostboost/asio/detail/handler_invoke_helpers.hpp(37) : error C2666: 'urdl::
detail::asio_handler_invoke' : 3 overloads have similar conversions
g:urdlincludeurdl/detail/http_read_stream.hpp(488): could be 'void ur
dl::detail::asio_handler_invoke<Function>(const Function &,urdl::detail::http_re
ad_stream<Stream>::read_handler<Handler> *)' [found using argument-dependent loo
kup]
with
[
....
环境是Win7+VS2010,你知道吗?
谢谢。
是的,你是对的,在新版本的boost中添加了一个名为asio_handler_invoke
的模板函数,它与在"http_read_stream.hpp(488)"定义的函数冲突。解决方法是注释用户定义的函数
在boost asio header "handler_invoke_helpers.hpp"中更改:
using boost::asio::asio_handler_invoke;
asio_handler_invoke(function, boost::asio::detail::addressof(context));
boost::asio::asio_handler_invoke(function, boost::asio::detail::addressof(context));
相关文章:
- 用MacOS Mojave编译C++:致命错误:mpi.h:没有这样的文件或目录
- std::is_base_of表示ctor编译错误
- 我的项目不会像"undefined reference to `grpc::g_core_codegen_interface'"那样使用未定义的引用错误进行编译
- 在没有定义返回类型的函数中返回布尔值,并将结果保存在无错误的char编译中-为什么
- Qt5:使用QCommandLineParser类时出现奇怪的编译错误
- Qt Cmake 错误编译"GuiSupportQt not found"
- Opengl 精度转换错误编译错误 E0415
- 库将ARM架构错误编译为架构X64
- RT 音频 Mac 错误 g++ 编译错误
- 错误编译Boost.log
- 错误编译QT创建者 / QT窗口小部件示例
- 错误编译MIPS32
- Visual Studio 2013 中的错误(编译和运行代码)
- 链接错误编译qt项目在visual 2010
- 无法用模板错误编译nsgmls
- 奇怪的错误.编译失败
- 如果有人调用c++中的方法,则强制错误(编译时)
- 来自autoconf测试的错误编译命令
- 时间限制超出错误C++编译
- SFML 2.3 和 CodeBlocks 错误编译