Closed dsimog01 closed 2 years ago
Hey, you seem to be talking about file socket_adaptors.h
right?
You can add a macro right after the includes:
#if BOOST_VERSION >= 107000
#define GET_IO_SERVICE(s) ((boost::asio::io_context&)(s).get_executor().context())
#else
#define GET_IO_SERVICE(s) ((s).get_io_service())
#endif
Then implement it. Replace:
boost::asio::io_service& get_io_service()
{
return socket_.get_io_service();
}
with:
boost::asio::io_service& get_io_service()
{
return GET_IO_SERVICE(socket_);
}
Another solution would be to use a fork. Because the maintainer of this repo is inactive, people forked it and took over the development. This one is our MVP: https://github.com/CrowCpp/crow
Everything you need in there, including updates, and fixes. I recommend you use his fixes, updates and work, instead of the code here, which is outdated. The work made by the group CrowCpp is fantastic!
I am amazed. So fast and so good. The first solution you provided worked.
Ah, happy for you it worked! 👍
I get some errors with the repo you told me. Any ideas?
Hmm, currently looking into it. Indeed, I can reproduce the same error as you. Will get back, with a solution shortly.
Hi, CrowCpp/Crow requires you add #define CROW_MAIN
to the top of your main cpp file. This is to avoid multiple definitions when using multiple source files (We're working to remove the need for it however).
It works! Thank you!
Hi, CrowCpp/Crow requires you add
#define CROW_MAIN
to the top of your main cpp file. This is to avoid multiple definitions when using multiple source files (We're working to remove the need for it however).
You beat me to it :). I had just found https://github.com/CrowCpp/Crow/issues/150
socket_.get_io_service() seems to be deprecated, so I can't run a server using crow.