Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compilation error for BOOST version == 1.64 #29

Closed
choice17 opened this issue Oct 21, 2020 · 7 comments
Closed

compilation error for BOOST version == 1.64 #29

choice17 opened this issue Oct 21, 2020 · 7 comments

Comments

@choice17
Copy link

choice17 commented Oct 21, 2020

Compiler complaints the following which does not happened in BOOST version == 1.74 and it does not happened in ipkn/crow master branch.

/home/workspace/http_server_c/crow/include/crow/http_response.h:188:106: note:   no known conversion for argument 1 from ‘boost::system::error_code’ to ‘std::error_code’
In file included from /home/workspace/http_server_c/crow/include/crow/http_response.h:7:0,
                 from /home/workspace/http_server_c/crow/include/crow/routing.h:12,
                 from /home/workspace/http_server_c/crow/include/crow/app.h:16,
                 from /home/workspace/http_server_c/crow/include/crow.h:3,
                 from examples/helloworld.cpp:1:
/home/workspace/http_server_c/crow/include/crow/json.h: In function ‘void crow::json::escape(const string&, std::__cxx11::string&)’:
/home/workspace/http_server_c/crow/include/crow/json.h:50:31: warning: comparison is always true due to limited range of data type [-Wtype-limits]
                         if (0 <= c && c < 0x20)
                               ^
In file included from /home/local/libs/armnn-devenv/boost_armhf_install/include/boost/asio/write.hpp:618:0,
                 from /home/local/libs/armnn-devenv/boost_armhf_install/include/boost/asio/buffered_write_stream.hpp:29,
                 from /home/local/libs/armnn-devenv/boost_armhf_install/include/boost/asio/buffered_stream.hpp:22,
                 from /home/local/libs/armnn-devenv/boost_armhf_install/include/boost/asio.hpp:38,
                 from /home/workspace/http_server_c/crow/include/crow/http_request.h:3,
                 from /home/workspace/http_server_c/crow/include/crow/http_response.h:8,
                 from /home/workspace/http_server_c/crow/include/crow/routing.h:12,
                 from /home/workspace/http_server_c/crow/include/crow/app.h:16,
                 from /home/workspace/http_server_c/crow/include/crow.h:3,
                 from examples/helloworld.cpp:1:
/home/local/libs/armnn-devenv/boost_armhf_install/include/boost/asio/impl/write.hpp: In instantiation of ‘std::size_t boost::asio::write(SyncWriteStream&, const ConstBufferSequence&, CompletionCondition, boost::system::error_code&) [with SyncWriteStream = boost::asio::basic_stream_socket<boost::asio::ip::tcp>; ConstBufferSequence = std::vector<boost::asio::const_buffer>; CompletionCondition = crow::response::do_write_sendfile(Adaptor) [with Adaptor = crow::SocketAdaptor*]::<lambda(std::error_code, std::size_t)>; std::size_t = unsigned int]’:
/home/local/libs/armnn-devenv/boost_armhf_install/include/boost/asio/impl/write.hpp:80:40:   required from ‘std::size_t boost::asio::write(SyncWriteStream&, const ConstBufferSequence&, CompletionCondition) [with SyncWriteStream = boost::asio::basic_stream_socket<boost::asio::ip::tcp>; ConstBufferSequence = std::vector<boost::asio::const_buffer>; CompletionCondition = crow::response::do_write_sendfile(Adaptor) [with Adaptor = crow::SocketAdaptor*]::<lambda(std::error_code, std::size_t)>; std::size_t = unsigned int]’
/home/workspace/http_server_c/crow/include/crow/http_response.h:188:39:   required from ‘void crow::response::do_write_sendfile(Adaptor) [with Adaptor = crow::SocketAdaptor*]’
/home/workspace/http_server_c/crow/include/crow/http_connection.h:471:13:   required from ‘void crow::Connection<Adaptor, Handler, Middlewares>::do_write_static() [with Adaptor = crow::SocketAdaptor; Handler = crow::Crow<>; Middlewares = {}]’
/home/workspace/http_server_c/crow/include/crow/http_connection.h:358:32:   required from ‘void crow::Connection<Adaptor, Handler, Middlewares>::complete_request() [with Adaptor = crow::SocketAdaptor; Handler = crow::Crow<>; Middlewares = {}]’
/home/workspace/http_server_c/crow/include/crow/http_connection.h:322:61:   required from ‘crow::Connection<Adaptor, Handler, Middlewares>::handle()::<lambda()> [with Adaptor = crow::SocketAdaptor; Handler = crow::Crow<>; Middlewares = {}]’
/home/workspace/http_server_c/crow/include/crow/http_connection.h:322:54:   [ skipping 13 instantiation contexts, use -ftemplate-backtrace-limit=0 to disable ]
/home/workspace/http_server_c/crow/include/crow/http_server.h:197:25:   required from ‘crow::Server<Handler, Adaptor, Middlewares>::do_accept()::<lambda(boost::system::error_code)> [with Handler = crow::Crow<>; Adaptor = crow::SocketAdaptor; Middlewares = {}]’
/home/workspace/http_server_c/crow/include/crow/http_server.h:193:28:   required from ‘struct crow::Server<Handler, Adaptor, Middlewares>::do_accept() [with Handler = crow::Crow<>; Adaptor = crow::SocketAdaptor; Middlewares = {}]::<lambda(class boost::system::error_code)>’
/home/workspace/http_server_c/crow/include/crow/http_server.h:192:13:   required from ‘void crow::Server<Handler, Adaptor, Middlewares>::do_accept() [with Handler = crow::Crow<>; Adaptor = crow::SocketAdaptor; Middlewares = {}]’
/home/workspace/http_server_c/crow/include/crow/http_server.h:160:22:   required from ‘void crow::Server<Handler, Adaptor, Middlewares>::run() [with Handler = crow::Crow<>; Adaptor = crow::SocketAdaptor; Middlewares = {}]’
/home/workspace/http_server_c/crow/include/crow/app.h:123:17:   required from ‘void crow::Crow<Middlewares>::run() [with Middlewares = {}]’
examples/helloworld.cpp:12:25:   required from here
/home/local/libs/armnn-devenv/boost_armhf_install/include/boost/asio/impl/write.hpp:46:29: error: no match for call to ‘(crow::response::do_write_sendfile(Adaptor) [with Adaptor = crow::SocketAdaptor*]::<lambda(std::error_code, std::size_t)>) (boost::system::error_code&, std::size_t&)’
         completion_condition(ec, total_transferred)));
                             ^
In file included from /home/workspace/http_server_c/crow/include/crow/routing.h:12:0,
                 from /home/workspace/http_server_c/crow/include/crow/app.h:16,
                 from /home/workspace/http_server_c/crow/include/crow.h:3,
                 from examples/helloworld.cpp:1:
/home/workspace/http_server_c/crow/include/crow/http_response.h:188:106: note: candidate: crow::response::do_write_sendfile(Adaptor)::<lambda(std::error_code, std::size_t)> [with Adaptor = crow::SocketAdaptor*; std::size_t = unsigned int]
                     boost::asio::write(adaptor->socket(), buffers, [this](std::error_code ec, std::size_t)
                                                                                                          ^
/home/workspace/http_server_c/crow/include/crow/http_response.h:188:106: note:   no known conversion for argument 1 from ‘boost::system::error_code’ to ‘std::error_code’
In file included from /home/local/libs/armnn-devenv/boost_armhf_install/include/boost/asio/write.hpp:618:0,
                 from /home/local/libs/armnn-devenv/boost_armhf_install/include/boost/asio/buffered_write_stream.hpp:29,
                 from /home/local/libs/armnn-devenv/boost_armhf_install/include/boost/asio/buffered_stream.hpp:22,
                 from /home/local/libs/armnn-devenv/boost_armhf_install/include/boost/asio.hpp:38,
                 from /home/workspace/http_server_c/crow/include/crow/http_request.h:3,
                 from /home/workspace/http_server_c/crow/include/crow/http_response.h:8,
                 from /home/workspace/http_server_c/crow/include/crow/routing.h:12,
                 from /home/workspace/http_server_c/crow/include/crow/app.h:16,
                 from /home/workspace/http_server_c/crow/include/crow.h:3,
                 from examples/helloworld.cpp:1:
/home/local/libs/armnn-devenv/boost_armhf_install/include/boost/asio/impl/write.hpp:53:31: error: no match for call to ‘(crow::response::do_write_sendfile(Adaptor) [with Adaptor = crow::SocketAdaptor*]::<lambda(std::error_code, std::size_t)>) (boost::system::error_code&, std::size_t&)’
           completion_condition(ec, total_transferred)));
                               ^
In file included from /home/workspace/http_server_c/crow/include/crow/routing.h:12:0,
                 from /home/workspace/http_server_c/crow/include/crow/app.h:16,
                 from /home/workspace/http_server_c/crow/include/crow.h:3,
                 from examples/helloworld.cpp:1:
/home/workspace/http_server_c/crow/include/crow/http_response.h:188:106: note: candidate: crow::response::do_write_sendfile(Adaptor)::<lambda(std::error_code, std::size_t)> [with Adaptor = crow::SocketAdaptor*; std::size_t = unsigned int]
                     boost::asio::write(adaptor->socket(), buffers, [this](std::error_code ec, std::size_t)
                                                                                                          ^
/home/workspace/http_server_c/crow/include/crow/http_response.h:188:106: note:   no known conversion for argument 1 from ‘boost::system::error_code’ to ‘std::error_code’
Makefile:52: recipe for target 'helloworld' failed
@The-EDev
Copy link
Member

The-EDev commented Oct 21, 2020

The problem here is that between boost 1.6 and 1.7 they seem to have changed completion_condition() function.

We are developing and testing with boost 1.7, ipkn/crow uses boost 1.5

@mrozigor
Copy link
Member

Is this a problem to update to the newest boost @choice17 ? ;)

@choice17
Copy link
Author

Is this a problem to update to the newest boost @choice17 ? ;)

Not really, however, it would be nice to have it compatible to lower version.

@mrozigor
Copy link
Member

mrozigor commented Oct 23, 2020

I'm not sure if that's a good idea. It requires additional work and it looks like a quirk in only one version of boost.

@The-EDev
Copy link
Member

we could potentially add a macro to check the boost version, and add a warning at the start of the application that "support for boost versions below 1.7 is deprecated and will be removed in a future release" just as a transition, this check would need to be added to the parts that @mrozigor changed while adding support to 1.7, and the socket shutdown parts added by me.

@mrozigor what do you think?

@mrozigor
Copy link
Member

If this isn't really necessary then I think that this is waste of time.

@The-EDev
Copy link
Member

closing this for now, @choice17 feel free to reopen if this issue is really important

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants