qicosmos / rest_rpc

modern C++(C++11), simple, easy to use rpc framework
MIT License
1.66k stars 365 forks source link

fix issue #42 #43

Closed jiezenghuang closed 2 years ago

jiezenghuang commented 3 years ago

解决include/rest_rpc/use_asio.hpp中直接使用using namespace boost;导致的命名空间污染。

qicosmos commented 3 years ago

Hi 你测试一下使用不用boost.asio,使用独立版asio的情况,看看测试能否通过。

jiezenghuang commented 3 years ago

我们项目的日志也是用的boos.log,所以手上暂时没有独立的asio。

发送自 Windows 10 版邮件https://go.microsoft.com/fwlink/?LinkId=550986应用

发件人: qicosmosmailto:notifications@github.com 发送时间: 2021年3月2日 12:47 收件人: qicosmos/rest_rpcmailto:rest_rpc@noreply.github.com 抄送: JieZeng Huangmailto:jiezeng.huang@hotmail.com; Authormailto:author@noreply.github.com 主题: Re: [qicosmos/rest_rpc] fix issue #42 (#43)

Hi 你测试一下使用不用boost.asio,使用独立版asio的情况,看看测试能否通过。

― You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/qicosmos/rest_rpc/pull/43#issuecomment-788581395, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AEN7I6R2P6VJFD7LHBCKHRLTBRUWNANCNFSM4YN3KHJA.

qicosmos commented 3 years ago

独立版的asio在github上下载就可以了,直接包含头文件就可以用的。

jiezenghuang commented 3 years ago

好像不行。感觉是独立版asio和boost不能一起用。

不加ASIO_STANDALONE宏,使用boost.asio时的错误: 1>E:\Git\rest_rpc\include\rest_rpc\rpc_client.hpp(294,12): warning C4244: 'return': conversion from 'uint64_t' to 'long', possible loss of data 1>E:\Git\rest_rpc\include\rest_rpc\rpc_client.hpp(588,36): warning C4244: 'argument': conversion from 'uint64_t' to 'long', possible loss of data 1>D:\Soft\opencv\build\include\opencv2\flann\dist.h(931,1): error C2872: 'log': ambiguous symbol 1>D:\Soft\opencv\build\include\opencv2\flann\dist.h(931,1): message : could be 'log' 1>D:\Soft\PCL-1.11.1\3rdParty\Boost\include\boost-1_74\boost\log\sinks\event_log_backend.hpp(50,1): message : or 'boost::log' 1>D:\Soft\opencv\build\include\opencv2\flann\dist.h(931,1): message : This diagnostic occurred in the compiler generated function 'Accumulator::Type cvflann::KL_Divergence::operator ()(Iterator1,Iterator2,size_t,Accumulator::Type) const' 1>D:\Soft\opencv\build\include\opencv2\flann\dist.h(959): message : see reference to class template instantiation 'cvflann::KL_Divergence' being compiled 1>D:\Soft\opencv\build\include\opencv2\flann\dist.h(954,1): error C2872: 'log': ambiguous symbol 1>D:\Soft\opencv\build\include\opencv2\flann\dist.h(954,1): message : could be 'log' 1>D:\Soft\PCL-1.11.1\3rdParty\Boost\include\boost-1_74\boost\log\sinks\event_log_backend.hpp(50,1): message : or 'boost::log'

1> D:\Soft\opencv\build\include\opencv2\flann\dist.h(954,1): message : This diagnostic occurred in the compiler generated function 'Accumulator::Type cvflann::KL_Divergence::accum_dist(const U &,const V &,int) const'

添加ASIO_STANDALONE宏及独立asio(E:\Git\asio\asio\include)时的错误: 1>D:\Soft\PCL-1.11.1\3rdParty\Boost\include\boost-1_74\boost\system\error_code.hpp(572,1): error C2011: 'std::error_code': 'class' type redefinition 1>D:\Soft\PCL-1.11.1\3rdParty\Boost\include\boost-1_74\boost\system\error_code.hpp(39): message : see declaration of 'std::error_code' 1>D:\Soft\PCL-1.11.1\3rdParty\Boost\include\boost-1_74\boost\system\error_code.hpp(745,36): error C3615: constexpr function 'boost::system::operator !=' cannot result in a constant expression 1>D:\Soft\PCL-1.11.1\3rdParty\Boost\include\boost-1_74\boost\system\error_code.hpp(747,19): message : failure was caused by call of undefined function or one not declared 'constexpr'

1> D:\Soft\PCL-1.11.1\3rdParty\Boost\include\boost-1_74\boost\system\error_code.hpp(747,19): message : see usage 。。。。。。。

发送自 Windows 10 版邮件https://go.microsoft.com/fwlink/?LinkId=550986应用

发件人: qicosmosmailto:notifications@github.com 发送时间: 2021年3月2日 14:13 收件人: qicosmos/rest_rpcmailto:rest_rpc@noreply.github.com 抄送: JieZeng Huangmailto:jiezeng.huang@hotmail.com; Authormailto:author@noreply.github.com 主题: Re: [qicosmos/rest_rpc] fix issue #42 (#43)

独立版的asio在github上下载https://github.com/chriskohlhoff/asio就可以了,直接包含头文件就可以用的。

― You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/qicosmos/rest_rpc/pull/43#issuecomment-788644430, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AEN7I6QTSOCRBYFJ7SQC6VDTBR62JANCNFSM4YN3KHJA.

qicosmos commented 3 years ago

你修改之前的代码是可以使用独立版的asio的,至于你说的opencv的问题是不是有其它解决方法? 我的本意是即支持boost.asio又能支持独立版asio,方便用户使用。

qicosmos commented 2 years ago

已经移除了对boost的依赖。