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

Compile error in tests on Windows in MSVS 2019 #835

Open
ales-kunst opened this issue Aug 1, 2019 · 7 comments
Open

Compile error in tests on Windows in MSVS 2019 #835

ales-kunst opened this issue Aug 1, 2019 · 7 comments

Comments

@ales-kunst
Copy link

ales-kunst commented Aug 1, 2019

When I try to compile the tests in MSVS 2019 I get following compile-time errors:

Severity Code Description Project File Line Suppression State Error C2678 binary '==': no operator found which takes a left-hand operand of type 'const Executor' (or there is no acceptable conversion) with [ Executor=std::reference_wrapper<boost::asio::io_service> ] test_endpoint D:\programming\projects\cpp\3rdparty\boost_1_70_0\boost\asio\impl\executor.hpp 218 Error C2678 binary '==': no operator found which takes a left-hand operand of type 'const Executor' (or there is no acceptable conversion) with [ Executor=std::reference_wrapper<boost::asio::io_service> ] test_transport_asio_security D:\programming\projects\cpp\3rdparty\boost_1_70_0\boost\asio\impl\executor.hpp 218 Error C3861 'sleep': identifier not found test_transport D:\programming\projects\cpp\3rdparty\websocketpp\test\transport\integration.cpp 319 Error C3861 'sleep': identifier not found test_transport D:\programming\projects\cpp\3rdparty\websocketpp\test\transport\integration.cpp 402 Error C3861 'sleep': identifier not found test_transport D:\programming\projects\cpp\3rdparty\websocketpp\test\transport\integration.cpp 427 Error C3861 'sleep': identifier not found test_transport D:\programming\projects\cpp\3rdparty\websocketpp\test\transport\integration.cpp 448 Error C3861 'sleep': identifier not found test_transport D:\programming\projects\cpp\3rdparty\websocketpp\test\transport\integration.cpp 468 Error C3861 'sleep': identifier not found test_transport D:\programming\projects\cpp\3rdparty\websocketpp\test\transport\integration.cpp 493 Error C3861 'sleep': identifier not found test_transport D:\programming\projects\cpp\3rdparty\websocketpp\test\transport\integration.cpp 526 Error C3861 'sleep': identifier not found test_transport D:\programming\projects\cpp\3rdparty\websocketpp\test\transport\integration.cpp 564 Error C3861 'sleep': identifier not found test_transport D:\programming\projects\cpp\3rdparty\websocketpp\test\transport\integration.cpp 574 Error C3861 'sleep': identifier not found test_transport D:\programming\projects\cpp\3rdparty\websocketpp\test\transport\integration.cpp 604 Error C3861 'sleep': identifier not found test_transport_asio_timers D:\programming\projects\cpp\3rdparty\websocketpp\test\transport\asio\timers.cpp 188

Did I do anything wrong or do I need to add some preprocessor directives. All errors are connected somehow with boost libraries (or maybe I am wrong). I am using boost libraries 1.70.

@ales-kunst ales-kunst changed the title Compile error in examples on Windows in MSVS 2019 Compile error in tests on Windows in MSVS 2019 Aug 1, 2019
@ales-kunst
Copy link
Author

The first two problems I have solved with the solution (removing lib::ref) from issue #794. But the "sleep: identifier not found" I do not know which sleep should I take (from boost thread?).

@analysisi
Copy link

二进制“==”: 没有找到接受“const Executor”类型的左操作数的运算符(或没有可接受的转换)

@vkaragounis
Copy link

Hi, i have the same error as @ales-kunst related to boost. I have tried 1.70 to 1.72 boost libraries to built with vs2019 but unsuccesfully

boost\asio\impl\executor.hpp(218,1): error C2678: binary '==': no operator found which takes a left-hand operand of type 'const Executor' (or there is no acceptable conversion)

Is something i can do in websocketpp or boost?

@qq635938204
Copy link

qq635938204 commented Mar 24, 2020

我也遇到了同样的问题,在笔记本上报错,但是在台式机上是正常的,如何解决?
vs2019 16.5.0
boost 1.72

@huhuang03
Copy link

huhuang03 commented Mar 25, 2020

As #794, you can use boost 1.69..

@vkaragounis
Copy link

vkaragounis commented Mar 25, 2020

I have overcome this issue by downloading 1.72 boost and building myself with cmake (gui).
The folder lib32-msvc-14.2 created after building boost library contains the dlls that are compatible.
Project built with Visual Studio 2019 (v142) platform toolset.
As i can recall, i download develop branch

@ales-kunst
Copy link
Author

ales-kunst commented Mar 25, 2020

I think that my question is duplicate to issue #794 . Anyway I have used the following command lines to replace/remove some lines of code from certain files (look in the command line) to be able to compile the project:

sed -re '/#include ^<syslog.h^>/ d' ^
< %repo_location%\tmp\websocketpp\websocketpp\logger\syslog.hpp.orig > %repo_location%\tmp\websocketpp\websocketpp\logger\syslog.hpp

if not exist "%repo_location%\tmp\websocketpp\websocketpp\transport\asio\connection.hpp.orig" (
copy %repo_location%\tmp\websocketpp\websocketpp\transport\asio\connection.hpp %repo_location%\tmp\websocketpp\websocketpp\transport\asio\connection.hpp.orig
)
sed -e 's/lib::ref(*m_io_service)/*m_io_service/' ^
-e 's/lib::ref(*io_service)/*io_service/' ^
< %repo_location%\tmp\websocketpp\websocketpp\transport\asio\connection.hpp.orig > %repo_location%\tmp\websocketpp\websocketpp\transport\asio\connection.hpp

if not exist "%repo_location%\tmp\websocketpp\websocketpp\transport\asio\endpoint.hpp.orig" (
copy %repo_location%\tmp\websocketpp\websocketpp\transport\asio\endpoint.hpp %repo_location%\tmp\websocketpp\websocketpp\transport\asio\endpoint.hpp.orig
)
sed -e 's/lib::ref(*m_io_service)/*m_io_service/' ^
< %repo_location%\tmp\websocketpp\websocketpp\transport\asio\endpoint.hpp.orig > %repo_location%\tmp\websocketpp\websocketpp\transport\asio\endpoint.hpp

if not exist "%repo_location%\tmp\websocketpp\websocketpp\transport\asio\security\none.hpp.orig" (
copy %repo_location%\tmp\websocketpp\websocketpp\transport\asio\security\none.hpp %repo_location%\tmp\websocketpp\websocketpp\transport\asio\security\none.hpp.orig
)
sed -e 's/lib::ref(*service)/*service/' ^
< %repo_location%\tmp\websocketpp\websocketpp\transport\asio\security\none.hpp.orig > %repo_location%\tmp\websocketpp\websocketpp\transport\asio\security\none.hpp

if not exist "%repo_location%\tmp\websocketpp\websocketpp\transport\asio\security\tls.hpp.orig" (
copy %repo_location%\tmp\websocketpp\websocketpp\transport\asio\security\tls.hpp %repo_location%\tmp\websocketpp\websocketpp\transport\asio\security\tls.hpp.orig
)
sed -e 's/lib::ref(*m_context)/*m_context/' ^
< %repo_location%\tmp\websocketpp\websocketpp\transport\asio\security\tls.hpp.orig > %repo_location%\tmp\websocketpp\websocketpp\transport\asio\security\tls.hpp

As you can see I used also sed.exe to make this.

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

5 participants