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

Does not compile with Boost 1.70 and newer #875

Open
vitakot opened this issue Jun 21, 2019 · 27 comments
Open

Does not compile with Boost 1.70 and newer #875

vitakot opened this issue Jun 21, 2019 · 27 comments

Comments

@vitakot
Copy link

vitakot commented Jun 21, 2019

https://www.boost.org/doc/libs/1_70_0/doc/html/boost_asio/history.html

Removed the deprecated member functions named io_service(). The get_io_service() member functions should be used instead.

@mihikjw
Copy link

mihikjw commented Jul 18, 2019

Hi, is anyone able to provide feedback on this issue, or at least provide the correct version of Boost?

I'm also unable to get the latest pull from github to compile with Boost 1_70_0, quoting not being able to find asio/tcp.hpp from boost/network/protocol/http/client/connection/normal_delegate.ipp:12:10.

I couldn't see a specific supported Boost version in the docs, only that it was a requirement.

@enricodetoma
Copy link

I made pull request #878 to address this problem

@oddvardm
Copy link

This library is seriously broken. I have now tried to use it with windows 10 and it is so screwed up it will not compile at all. Have spent 4 days going through CMake & diffrent versions of Boost & finaly gave up. I know that this is volunteer work, but it was reported almost 4 mounth ago. Please fix it or update document page with a installation procedure that works with Visual Studio & CMake.

@enricodetoma
Copy link

I use branch 0.13-release with Boost 1.70, Visual Studio 2017, cmake 3.15.1 and it's not broken at all.

@oddvardm
Copy link

oddvardm commented Oct 10, 2019 via email

@enricodetoma
Copy link

cxxopts is a dependancy.
Did you tell git to pull the dependancies too?

Also, did you try with branch 0.13-release instead of master?
In the past I had problems with master (don't remember exactly, it was quite some time ago), so I used originally branch 0.12-release and now 0.13-release

@oddvardm
Copy link

oddvardm commented Oct 10, 2019 via email

@enricodetoma
Copy link

I see that I'm not building examples nor tests.
Probably some months ago I had problems with them, so I disabled them in CMake-gui.
The library itself works correctly with http(s) (I only need http(s) in my project).

@oddvardm
Copy link

oddvardm commented Oct 10, 2019 via email

@oddvardm
Copy link

oddvardm commented Oct 11, 2019 via email

@oddvardm
Copy link

oddvardm commented Oct 11, 2019 via email

@enricodetoma
Copy link

enricodetoma commented Oct 11, 2019

About OpenSSL: using CMake-gui I put both OPEN_SSL_INCLUDE_DIR, SSL_EAY_RELEASE (full path to libssl.lib) and LIB_EAY_RELEASE (full path to libcrypto.lib) and it finds it correctly.

About boost 1.71: please pull latest branch 0.13-release, not master. I submitted a patch to make it work with boost >= 1.70 (where get_io_service was removed). I see that the patch has not been merged in master yet.

@oddvardm
Copy link

oddvardm commented Oct 11, 2019 via email

@oddvardm
Copy link

oddvardm commented Oct 11, 2019 via email

@oddvardm
Copy link

oddvardm commented Oct 11, 2019 via email

@enricodetoma
Copy link

Clone from standard link, then switch locally to 0.13-release branch. Don't download the zip, or you won't have the dependancies.

@enricodetoma
Copy link

Source directory is where you cloned the project. For build directory I usually put {source dir}/build but it's your choice.

@oddvardm
Copy link

oddvardm commented Oct 11, 2019 via email

@oddvardm
Copy link

oddvardm commented Oct 11, 2019 via email

@vitakot
Copy link
Author

vitakot commented Oct 11, 2019

I switched to Boost Beast library. It is better designed, much more powerful (WebSockets support) and just works. Of course I had to rewrite my request handlers, but it wasn't a big deal.

Cpp-netlib is a great library and was indispensable before the Boot Beast release which made it obsolete.

@oddvardm
Copy link

oddvardm commented Oct 11, 2019 via email

@vitakot
Copy link
Author

vitakot commented Oct 11, 2019

Europe, Czech Republic, Brno city.

@oddvardm
Copy link

oddvardm commented Oct 11, 2019 via email

@oddvardm
Copy link

oddvardm commented Oct 12, 2019 via email

@Plaristote
Copy link

Plaristote commented Jan 30, 2020

Let's get back on topic: cpp-netlib still does not compile with Boost 1.72.
The header boost/asio/stream_socket_service.hpp has been moved or removed, resulting in compilation errors in boost/network/protocol/stream_handler.hpp.

Removing line 22 in stream_handler.hpp is enough to fix the issue for me.

@Plaristote
Copy link

Plaristote commented Apr 8, 2020

Back on this issue, it turns out these modifications weren't enough. It was enough for my http server, but not for my clients.
Seems like uses of io_service should sometimes be replaced by io_context. There's at least one instance of that issue happening in stream_handler.hpp at line 54 (after removal of line 22). I unfortunately can't probe this issue any longer for today. I'll do my best to try and fix this in the following weeks, but I'm no asio expert, so don't take my work for it.

Note to self (or others who might be interested in fixing this), the following might be relevant:
https://stackoverflow.com/questions/56225374/alternative-to-missing-method-in-last-version-of-boost-asio-library

@TeaObvious
Copy link

TeaObvious commented May 1, 2020

For those that want to run cpp-netlib 0.13.0 with Boost >= 1.70 i have created a quick and maybe dirty patch to get the clients working that is only tested for my use case, so be aware it might not solve your problem!

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

6 participants