Skip to content

Fails to run on newer asio versions (Fix here too) #1170

Description

@vcmikuu

seems like it completely breaks on newer versions.
this is my error:

C:/Users/-/Documents/GitHub/X/include/websocketpp/transport/asio/connection.hpp:89:24: error: no type named 'io_service' in namespace 'websocketpp::lib::asio'
   89 |     typedef lib::asio::io_service * io_service_ptr;
      |             ~~~~~~~~~~~^
C:/Users/-/Documents/GitHub/X/include/websocketpp/transport/asio/connection.hpp:91:40: error: no member named 'io_service' in namespace 'websocketpp::lib::asio'
   91 |     typedef lib::shared_ptr<lib::asio::io_service::strand> strand_ptr;
      |                             ~~~~~~~~~~~^

websocket++ is not compatible with newer standalone asio versions (from 1.34.x onwards), because it still expects outdated types internally, like io_service and strand, which have been replaced in newer asio versions by things like io_context and strand etc.
so you need to use an older version of asio to make it work:

https://github.com/chriskohlhoff/asio/releases/tag/asio-1-24-0

or if you want a different fix, please look here:

#1157

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions