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

win10 vs2019工程中添加cinatra,编译错误 #172

Closed
chris-shenzhen-china opened this issue Nov 19, 2020 · 16 comments
Closed

win10 vs2019工程中添加cinatra,编译错误 #172

chris-shenzhen-china opened this issue Nov 19, 2020 · 16 comments

Comments

@chris-shenzhen-china
Copy link

io_service_pool.hpp(57,16): error C2039: 'io_service': is not a member of 'boost::asio' (compiling source file

@chris-shenzhen-china
Copy link
Author

io_service在新版本的asio库中已经废弃了,请问能适配到新版本的asio吗?

@qicosmos
Copy link
Owner

你用的是哪个版本的boost?

@qicosmos
Copy link
Owner

可以将它换成io_context试试。

@chris-shenzhen-china
Copy link
Author

没用boost,vcpkg install asio,1.18版本的asio, 除了io_service -> io_context; 还有很多用法都有问题:work也没有了

@chris-shenzhen-china
Copy link
Author

还有请教下,我的环境里面不支持 asio::ip::tcp::resolver::query,查看代码ip/basic_resolver.hpp中,下面这段代码是灰的,不知要在哪里undefine ASIO_NO_DEPRECATED
#if !defined(ASIO_NO_DEPRECATED)
/// (Deprecated.) The query type.
typedef basic_resolver_query query;

/// (Deprecated.) The iterator type.
typedef basic_resolver_iterator iterator;
#endif // !defined(ASIO_NO_DEPRECATED)

@qicosmos
Copy link
Owner

看来最新版本的asio变动不小,用boost的asio吧,或者换1.12版本的asio,github上就有取下来就行。

@chris-shenzhen-china
Copy link
Author

你好,请问啥时会支持https

@chris-shenzhen-china
Copy link
Author

看来最新版本的asio变动不小,用boost的asio吧,或者换1.12版本的asio,github上就有取下来就行。

不能改为老版本了,我里面有其他的用到asio的新版本了

@qicosmos
Copy link
Owner

你好,请问啥时会支持https

本来就支持ssl,例子里面有怎么用ssl。

@qicosmos
Copy link
Owner

还有请教下,我的环境里面不支持 asio::ip::tcp::resolver::query,查看代码ip/basic_resolver.hpp中,下面这段代码是灰的,不知要在哪里undefine ASIO_NO_DEPRECATED
#if !defined(ASIO_NO_DEPRECATED)
/// (Deprecated.) The query type.
typedef basic_resolver_query query;

/// (Deprecated.) The iterator type.
typedef basic_resolver_iterator iterator;
#endif // !defined(ASIO_NO_DEPRECATED)

你用的是cmake吗?

@chris-shenzhen-china
Copy link
Author

还有请教下,我的环境里面不支持 asio::ip::tcp::resolver::query,查看代码ip/basic_resolver.hpp中,下面这段代码是灰的,不知要在哪里undefine ASIO_NO_DEPRECATED
#if !defined(ASIO_NO_DEPRECATED)
/// (Deprecated.) The query type.
typedef basic_resolver_query query;
/// (Deprecated.) The iterator type.
typedef basic_resolver_iterator iterator;
#endif // !defined(ASIO_NO_DEPRECATED)

你用的是cmake吗?

是的,我刚在 cinatra.hpp中添加 #undef ASIO_NO_DEPRECATED,导致很多问题,看来不能添加,冲突很严重

@qicosmos
Copy link
Owner

不应该啊,在cmakelists.txt里面加 add_definitions(-DASIO_NO_DEPRECATED)

@chris-shenzhen-china
Copy link
Author

大侠能抽时间适配修改下支持最新的asio 1.18版本吗?感谢

@qicosmos
Copy link
Owner

ok,我抽空看看最新的asio是怎么回事。

@chris-shenzhen-china
Copy link
Author

chris-shenzhen-china commented Nov 20, 2020 via email

@qicosmos
Copy link
Owner

最新代码需要vs2022,需要c++20,可以用新版的msvc测试一下。

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

2 participants