EvEmu-Project / evemu_Crucible

Emulator for EvE Online's Crucible expansion
https://evemu.dev
170 stars 66 forks source link

Add define to workaround boost::asio::executor changes in Boost 1.74.0 #219

Closed novafacing closed 1 year ago

novafacing commented 1 year ago

eve-server fails to build with the following error when boost 1.74.0 or higher is installed, this workaround fixes the issue:

[ 64%] Building CXX object src/eve-server/CMakeFiles/eve-server.dir/inventory/InventoryBound.cpp.o
In file included from /usr/include/boost/asio/executor.hpp:342,
                 from /usr/include/boost/asio.hpp:99,
                 from /home/novafacing/hub/evemu_Crucible/src/eve-core/eve-core.h:130,
                 from /home/novafacing/hub/evemu_Crucible/src/eve-common/eve-common.h:33,
                 from /home/novafacing/hub/evemu_Crucible/src/eve-server/eve-server.h:33:
/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 = boost::asio::any_io_executor; Allocator = std::allocator<void>]’:
/usr/include/boost/asio/impl/executor.hpp:76:8:   required from here
/usr/include/boost/asio/impl/executor.hpp:78:15: error: ‘class boost::asio::any_io_executor’ has no member named ‘on_work_started’
   78 |     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 = boost::asio::any_io_executor; Allocator = std::allocator<void>]’:
/usr/include/boost/asio/impl/executor.hpp:81:8:   required from here
/usr/include/boost/asio/impl/executor.hpp:83:15: error: ‘class boost::asio::any_io_executor’ has no member named ‘on_work_finished’
   83 |     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 = boost::asio::any_io_executor; Allocator = std::allocator<void>; boost::asio::executor::function = boost::asio::detail::executor_function]’:
/usr/include/boost/asio/impl/executor.hpp:91:8:   required from here
/usr/include/boost/asio/impl/executor.hpp:93:15: error: ‘class boost::asio::any_io_executor’ has no member named ‘dispatch’
   93 |     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 = boost::asio::any_io_executor; Allocator = std::allocator<void>; boost::asio::executor::function = boost::asio::detail::executor_function]’:
/usr/include/boost/asio/impl/executor.hpp:96:8:   required from here
/usr/include/boost/asio/impl/executor.hpp:98:15: error: ‘class boost::asio::any_io_executor’ has no member named ‘post’
   98 |     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 = boost::asio::any_io_executor; Allocator = std::allocator<void>; boost::asio::executor::function = boost::asio::detail::executor_function]’:
/usr/include/boost/asio/impl/executor.hpp:101:8:   required from here
/usr/include/boost/asio/impl/executor.hpp:103:15: error: ‘class boost::asio::any_io_executor’ has no member named ‘defer’; did you mean ‘prefer’?
  103 |     executor_.defer(BOOST_ASIO_MOVE_CAST(function)(f), allocator_);
      |     ~~~~~~~~~~^~~~~
      |     prefer
make[2]: *** [src/eve-server/CMakeFiles/eve-server.dir/build.make:1622: src/eve-server/CMakeFiles/eve-server.dir/imageserver/ImageServerListener.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....

Ref: https://stackoverflow.com/questions/65840258/boost-1-74-0-asio-executor-migration-issues

novafacing commented 1 year ago

The BOOST_VERSION define is defined in <boost/version.hpp>, not by default. Added a follow up to include that version file.

jdhirst commented 1 year ago

!oktotest

jdhirst commented 1 year ago

@novafacing Looks good to me, thanks for the contribution!