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

Build failing #212

Closed
AshotN opened this issue Aug 27, 2018 · 13 comments
Closed

Build failing #212

AshotN opened this issue Aug 27, 2018 · 13 comments

Comments

@AshotN
Copy link

AshotN commented Aug 27, 2018

I'm getting a ton of errors saying

overriding virtual function has less restrictive exception specification than base class virtual member function

Using Visual Studio 17 on Windows 10

@Jackey-Huo
Copy link

@AshotN I got the same error. Have you found any solution about it?

@AshotN
Copy link
Author

AshotN commented Feb 26, 2019

I gave up on the project I was working on related to this. Sorry I couldn't be more helpful

@Jackey-Huo
Copy link

Jackey-Huo commented Feb 26, 2019

I've resolved the bug. This repo depends on websocketpp as submodules. The websocktpp version has been out of date. update the websocktpp to latest commit will resolve all trouble ;)

@Jackey-Huo
Copy link

Jackey-Huo commented Jul 6, 2019 via email

@keniiyoshi
Copy link

I did this for building the INSTALL project, and it worked!
However, I got these set of new errors, which repeated 3 times in sioclient project, io_object_impl.hpp line 87:

C2039 'get_executor': is not a member of 'boost::reference_wrapperboost::asio::io_service'
C2665 'boost::asio::detail::io_object_executor::io_object_executor': none of the 3 overloads could convert all the argument types
with
[
Executor=boost::asio::executor
]

Did you come across these errors and found a fix?

I'm using Visual Studio 19 on Windows 10.

@Jackey-Huo
Copy link

Jackey-Huo commented Jul 9, 2019 via email

@coreyp1
Copy link

coreyp1 commented Aug 23, 2019

I confirm the new error that keniiyoshi is reporting. I updated my websocketpp according to Jackey-Huo's instructions, and, once I #include<sio_client.h> (as in, just that single line will trigger the problem), the new errors show up. I'm using VS2019.

@coreyp1
Copy link

coreyp1 commented Aug 23, 2019

Whew. Finally figured out what was happening.

  1. websocketpp, even after being updated, absolutely will not compile with anything after boost 1.69. (I was originally trying to use Boost 1.71.

  2. Boost 1.69 pre-built binaries for Windows don't exist for msvc-14.2 (e.g., VS2019), and I couldn't get the msvc-14.1 ones (originally for VS2017) to work with VS2019. Maybe it's a PEBCAK issue, but I'm new to Visual Studio in general.

  3. Boost 1.69 build tools doesn't support VS2019.

  4. Basically, it took a 3 days of messing around to finally get Boost 1.69 to compile under VS2019 (msvc-14.2).

After all of that, socket.io wouldn't compile, because in 2 places in sio_client_impl.cpp, I kept getting compiler error C3321 "An initializer list is unexpected in this context".

Basically, there were two lines like this: LOG("blah blah blah"){};

The compiler doesn't like it. I had to delete the spurious {}, and then everything finally compiled.

I'm leaving this comment here in case it helps someone else.

@Jackey-Huo
Copy link

@coreyp1 Congratulation! It seems you have experienced a quite struggle days ;)
BTW is this Issue could be regarded as solved and shall we close it? @AshotN @melode11

@coreyp1
Copy link

coreyp1 commented Aug 24, 2019

I don't think that it was "solved", but rather "worked around". I see 3 issues, in which 1 can't be fixed, and 2 which should be patched.

  1. Websocketpp doesn't work with Boost after 1.69. See Version 0.8.1 is incompatible with Boost 1.70.0 zaphoyd/websocketpp#808 and Can't compile anything with latest version of standalone asio zaphoyd/websocketpp#794. Obviously, this project can't do anything about that, and must wait for websocketpp to fix their issues.

  2. The version of Websocketpp library that is linked to is from 2015. This should at least be updated in order to eliminate the compile error message originally reported at the top of this issue. At the very least, even if the update doesn't solve the Boost version problem, it does eliminate a huge group of compile errors in VS2017 and VS2019.

  3. In sio_client_impl.cpp (https://github.com/socketio/socket.io-client-cpp/blob/master/src/internal/sio_client_impl.cpp), the extra {} should be removed, as it is incompatible syntax for modern compilers. Specifically, line 282 should change from
    LOG("ping exit,con is expired?"<<m_con.expired()<<",ec:"<<ec.message()<<endl){};
    to
    LOG("ping exit,con is expired?"<<m_con.expired()<<",ec:"<<ec.message()<<endl);
    And line 496 should change from
    if(ec)LOG("ec:"<<ec.message()<<endl){};
    to
    if(ec)LOG("ec:"<<ec.message()<<endl);
    or
    if(ec){LOG("ec:"<<ec.message()<<endl)};
    depending on your coding style.

I don't think that this issue should be marked as resolved until 2 and 3 are done, though, because that is what it will take to make the project compile. The Boost 1.69 situation is merely a linking issue.

@rthickling
Copy link

Note that I see zaphoyd has pointed out that in websocketpp "The fix for this issue has been available on the develop branch for some time and has now been published in release 0.8.2".

@richardeakin
Copy link

Just want to point out that 2.x branch still needs an update for the LOG()..{} compile error in sio_client_impl.cpp. Thanks for documenting that fix @coreyp1

richardeakin added a commit to richardeakin/socket.io-client-cpp that referenced this issue Apr 22, 2021
darrachequesne pushed a commit that referenced this issue Apr 23, 2021
@darrachequesne
Copy link
Member

This should be fixed now. Please reopen if needed.

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

7 participants