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

1.1.2 won't build against boost-1.70.0 #368

Closed
Ponce opened this issue Apr 16, 2019 · 4 comments
Closed

1.1.2 won't build against boost-1.70.0 #368

Ponce opened this issue Apr 16, 2019 · 4 comments

Comments

@Ponce
Copy link

Ponce commented Apr 16, 2019

Platform: Slackware64-current
Boost: 1.70.0
gcc: 8.3.0

relevant build output:

g++ -c -pipe -O2 -Wall -W -D_REENTRANT -fPIC -DENABLE_IPV6 -DTIXML_USE_STL -DBOOST_FILESYSTEM_DEPRECATED -DQT_NO_DEBUG -I/usr/lib64/qt/mkspecs/linux-g++ -I. -I/usr/lib64/qt/include -I. -Isrc -Isrc/engine -Isrc/gui -Isrc/gui/qt -Isrc/gui/qt/qttools -Isrc/net -Isrc/engine/local_engine -Isrc/engine/network_engine -Isrc/config -Isrc/core -Isrc/third_party/websocketpp -I
/usr/include -I/opt/gsasl/include -Imocs -o obj/clientbero.o src/engine/network_engine/clientbero.cpp
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -fPIC -DENABLE_IPV6 -DTIXML_USE_STL -DBOOST_FILESYSTEM_DEPRECATED -DQT_NO_DEBUG -I/usr/lib64/qt/mkspecs/linux-g++ -I. -I/usr/lib64/qt/include -I. -Isrc -Isrc/engine -Isrc/gui -Isrc/gui/qt -Isrc/gui/qt/qttools -Isrc/net -Isrc/engine/local_engine -Isrc/engine/network_engine -Isrc/config -Isrc/core -Isrc/third_party/websocketpp -I
/usr/include -I/opt/gsasl/include -Imocs -o obj/chatcleanermanager.o src/net/common/chatcleanermanager.cpp
In file included from /usr/include/boost/asio/executor.hpp:338,                                                                                                                 
                 from /usr/include/boost/asio/basic_socket.hpp:27,                                                                                                                                                                                   
                 from /usr/include/boost/asio/basic_datagram_socket.hpp:20,                                                                                                                       
                 from /usr/include/boost/asio.hpp:24,                                                                                                                                    
                 from src/net/chatcleanermanager.h:36,                                                                                                                                                                                                                                                                                                                         
                 from src/net/common/chatcleanermanager.cpp:32:                                            
/usr/include/boost/asio/impl/executor.hpp: In instantiation of ‘boost::asio::execution_context& boost::asio::executor::impl< <template-parameter-1-1>, <template-parameter-1-2> >::context() [with Executor = std::reference_wrapper<boost::asio::io_context>; Allocator = std::allocator<void>]’:
/usr/include/boost/asio/impl/executor.hpp:177:22:   required from here                                       
/usr/include/boost/asio/impl/executor.hpp:179:22: error: ‘class std::reference_wrapper<boost::asio::io_context>’ has no member named ‘context’                                                       
     return executor_.context();                                           
            ~~~~~~~~~~^~~~~~~                                                                                                                                                               
/usr/include/boost/asio/impl/executor.hpp: In instantiation of ‘void boost::asio::executor::impl< <template-parameter-1-1>, <template-parameter-1-2> >::on_work_started() [with Executor = std::reference_wrapper<boost::asio::io_context>; Allocator = std::allocator<void>]’:
/usr/include/boost/asio/impl/executor.hpp:167:8:   required from here                                                                                                       
/usr/include/boost/asio/impl/executor.hpp:169:15: error: ‘class std::reference_wrapper<boost::asio::io_context>’ has no member named ‘on_work_started’                                                                   
     executor_.on_work_started();                                                                                                                                                  
     ~~~~~~~~~~^~~~~~~~~~~~~~~                                                     
/usr/include/boost/asio/impl/executor.hpp: In instantiation of ‘void boost::asio::executor::impl< <template-parameter-1-1>, <template-parameter-1-2> >::on_work_finished() [with Executor = std::reference_wrapper<boost::asio::io_context>; Allocator = std::allocator<void>]’:
/usr/include/boost/asio/impl/executor.hpp:172:8:   required from here                                   
/usr/include/boost/asio/impl/executor.hpp:174:15: error: ‘class std::reference_wrapper<boost::asio::io_context>’ has no member named ‘on_work_finished’         
     executor_.on_work_finished();                                                                      
     ~~~~~~~~~~^~~~~~~~~~~~~~~~                                                                                                                                                                                                                                                                                                                                    
/usr/include/boost/asio/impl/executor.hpp: In instantiation of ‘void boost::asio::executor::impl< <template-parameter-1-1>, <template-parameter-1-2> >::dispatch(boost::asio::executor::function&&) [with Executor = std::reference_wrapper<boost::asio::io_context>; Allocator = std::allocator<void>]’:
/usr/include/boost/asio/impl/executor.hpp:182:8:   required from here                                                                                                                                                                
/usr/include/boost/asio/impl/executor.hpp:184:15: error: ‘class std::reference_wrapper<boost::asio::io_context>’ has no member named ‘dispatch’                                                                                                                        
     executor_.dispatch(BOOST_ASIO_MOVE_CAST(function)(f), allocator_);                                                                                           
     ~~~~~~~~~~^~~~~~~~                                                                                                                                                                  
/usr/include/boost/asio/impl/executor.hpp: In instantiation of ‘void boost::asio::executor::impl< <template-parameter-1-1>, <template-parameter-1-2> >::post(boost::asio::executor::function&&) [with Executor = std::reference_wrapper<boost::asio::io_context>; Allocator = std::allocator<void>]’:
/usr/include/boost/asio/impl/executor.hpp:187:8:   required from here                  
/usr/include/boost/asio/impl/executor.hpp:189:15: error: ‘class std::reference_wrapper<boost::asio::io_context>’ has no member named ‘post’                        
     executor_.post(BOOST_ASIO_MOVE_CAST(function)(f), allocator_);                                               
     ~~~~~~~~~~^~~~                                                                                                                                                                                       
/usr/include/boost/asio/impl/executor.hpp: In instantiation of ‘void boost::asio::executor::impl< <template-parameter-1-1>, <template-parameter-1-2> >::defer(boost::asio::executor::function&&) [with Executor = std::reference_wrapper<boost::asio::io_context>; Allocator = std::allocator<void>]’:
/usr/include/boost/asio/impl/executor.hpp:192:8:   required from here                                                                                                                                                                            
/usr/include/boost/asio/impl/executor.hpp:194:15: error: ‘class std::reference_wrapper<boost::asio::io_context>’ has no member named ‘defer’                                                                                                         
     executor_.defer(BOOST_ASIO_MOVE_CAST(function)(f), allocator_);                                                                                                                                                                             
     ~~~~~~~~~~^~~~~                                                                                                                                                                                                                                           
/usr/include/boost/asio/impl/executor.hpp: In instantiation of ‘bool boost::asio::executor::impl< <template-parameter-1-1>, <template-parameter-1-2> >::equals(const boost::asio::executor::impl_base*) const [with Executor = std::reference_wrapper<boost::asio::io_context>; Allocator = std::allocator<void>]’:
/usr/include/boost/asio/impl/executor.hpp:212:8:   required from here                                                                                                                                                                                                           
/usr/include/boost/asio/impl/executor.hpp:218:22: error: no match for ‘operator==’ (operand types are ‘const std::reference_wrapper<boost::asio::io_context>’ and ‘const std::reference_wrapper<boost::asio::io_context>’)
     return executor_ == *static_cast<const Executor*>(e->target());

a couple of patches (pasted below) for boost 1.65 and 1.66 are already applied

Boost 1.65 made 'advance()' ambiguous.
Bug: https://bugs.gentoo.org/show_bug.cgi?id=629966

--- a/src/gui/qt/gametable/gametableimpl.cpp
+++ b/src/gui/qt/gametable/gametableimpl.cpp
@@ -3859,7 +3859,7 @@
        int playerCount = static_cast<int>(seatList->size());
        if (id < playerCount) {
                PlayerListIterator pos = seatList->begin();
-               advance(pos, id);
+               std::advance(pos, id);
                myStartWindow->getSession()->startVoteKickPlayer((*pos)->getMyUniqueID());
        }
 }
diff -Naur pokerth-1.1.2-rc.orig/src/net/common/clientthread.cpp pokerth-1.1.2-rc/src/net/common/clientthread.cpp
--- pokerth-1.1.2-rc.orig/src/net/common/clientthread.cpp       2017-08-16 14:24:03.000000000 +0200
+++ pokerth-1.1.2-rc/src/net/common/clientthread.cpp    2017-12-23 21:48:58.660592917 +0100
@@ -993,8 +993,7 @@
                        newSock.reset(new boost::asio::ip::tcp::socket(*m_ioService, tcp::v6()));
                else
                        newSock.reset(new boost::asio::ip::tcp::socket(*m_ioService, tcp::v4()));
-               boost::asio::socket_base::non_blocking_io command(true);
-               newSock->io_control(command);
+               newSock->non_blocking(true);
                newSock->set_option(tcp::no_delay(true));
                newSock->set_option(boost::asio::socket_base::keep_alive(true));
 
diff -Naur pokerth-1.1.2-rc.orig/src/net/serveraccepthelper.h pokerth-1.1.2-rc/src/net/serveraccepthelper.h
--- pokerth-1.1.2-rc.orig/src/net/serveraccepthelper.h  2017-08-16 14:24:03.000000000 +0200
+++ pokerth-1.1.2-rc/src/net/serveraccepthelper.h       2017-12-23 22:05:51.075613870 +0100
@@ -122,8 +122,7 @@
                                          const boost::system::error_code &error)
        {
                if (!error) {
-                       boost::asio::socket_base::non_blocking_io command(true);
-                       acceptedSocket->io_control(command);
+                       acceptedSocket->non_blocking(true);
                        acceptedSocket->set_option(typename P::no_delay(true));
                        acceptedSocket->set_option(boost::asio::socket_base::keep_alive(true));
                        boost::shared_ptr<SessionData> sessionData(new SessionData(acceptedSocket, m_lobbyThread->GetNextSessionId(), m_lobbyThread->GetSessionDataCallback(), *m_ioService));
@albmed
Copy link
Member

albmed commented Apr 23, 2019

Hi @Ponce

Thanks for reporting this.
We'll fix as soon as possible.

Regards,
Albert.

@albmed
Copy link
Member

albmed commented Apr 24, 2019

Hi,

It looks it's an issue of websocket library regarding some deprecated features from asio, and now removed. See zaphoyd/websocketpp#794

I've made a test applying this fix on websocket library itself, and now it compiles with boost 1.70.0 (at least, the file that failed: chatcleanermanager).

Nevertheless, we'll wait until websocket creates a new release to make sure, everything works (or at least, they accept the pull request). For now, you better use any previous version of boost library.

Regards,
Albert.

@Ponce
Copy link
Author

Ponce commented Apr 24, 2019

thanks a lot @albmed , I can confirm that applying that let me build fine against the newer boost.

@Ponce Ponce closed this as completed Apr 24, 2019
@albmed
Copy link
Member

albmed commented Apr 24, 2019

Thanks a lot for testing @Ponce. Good to know you could have built. I'll append this info to our wiki.
Anyway, we'll wait for a release of websocket stable version, before apply it into our stable branch.

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