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

Standalone ASIO, VS2013, compilation problem #462

Closed
mhirsch opened this issue Aug 29, 2015 · 1 comment
Closed

Standalone ASIO, VS2013, compilation problem #462

mhirsch opened this issue Aug 29, 2015 · 1 comment

Comments

@mhirsch
Copy link

mhirsch commented Aug 29, 2015

I'm trying to compile a modified version of the telemetry_server example under Windows 8.1 x64 with MSVC 2013 and with the most recent standalone asio from https://github.com/chriskohlhoff/asio.git. I would like to do this without using boost. Before including websocketpp/config/asio_no_tls.hpp I have defined

#define _WEBSOCKETPP_CPP11_THREAD_
#define _WEBSOCKETPP_CPP11_CHRONO_
#define _WEBSOCKETPP_CPP11_TYPE_TRAITS_
#define ASIO_STANDALONE
#define ASIO_HAS_STD_ARRAY
#define ASIO_HAS_STD_ATOMIC
#define ASIO_HAS_CSTDINT
#define ASIO_HAS_STD_ADDRESSOF
#define ASIO_HAS_STD_SHARED_PTR
#define ASIO_HAS_STD_TYPE_TRAITS

I get this compiler error:
Error 4 error C3206: 'std::make_shared' : invalid template argument for '_Ty', missing template argument list on class template 'asio::strand' websocketpp\websocketpp\transport\asio\connection.hpp 443

This is in the function init_asio(io_service_ptr io_service)

Line 442/443 is
m_strand = lib::make_shared<lib::asio::strand>(lib::ref(*io_service));

Error C3206 seems to be triggered because lib::asio::strand is defined as template<class Executor> class asio::strand<Executor> and MSVC wants the Executor type to be named in the template, like

m_strand = lib::make_shared<lib::asio::strand<type> >(lib::ref(*io_service));

I'm not sure what type this would be here...

@mhirsch mhirsch changed the title Standalone ASIO, MSVC 2013, compilation problem Standalone ASIO, VS2013, compilation problem Aug 29, 2015
Meoo added a commit to Meoo/websocketpp that referenced this issue Nov 24, 2015
Fix compilation with standalone ASIO (zaphoyd#462), where asio::strand and asio::io_service::strand are separate types.
This is the correct type, as m_strand is a ``lib::shared_ptr<lib::asio::io_service::strand>``
@jeremyong
Copy link

This can be closed I believe.

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

No branches or pull requests

3 participants