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

Error while compiling (<optional> header missing + hash<boost::asio::ip::address> redefinition) #169

Closed
protozis opened this issue Aug 8, 2021 · 4 comments
Milestone

Comments

@protozis
Copy link

protozis commented Aug 8, 2021

OS: Archlinux

  1. Missing header
    When compiling src/libs/utils/CMakeFiles/lmsutils.dir/impl/ChildProcess.cpp.o, it appears that the header file <optional> was missing. Adding the header to ChileProcess.hpp resolve the problem.

  2. Object redefinition
    Following errors appeared while compiling:

Consolidate compiler generated dependencies of target lmsutils
[  0%] Building CXX object src/libs/utils/CMakeFiles/lmsutils.dir/impl/NetAddress.cpp.o
In file included from /home/jerry/public_html/lms/src/libs/utils/impl/NetAddress.cpp:20:
/home/jerry/public_html/lms/src/libs/utils/include/utils/NetAddress.hpp:26:27: error: redefinition of ‘struct std::hash<boost::asio::ip::address>’
   26 |         template<> struct hash<boost::asio::ip::address>
      |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/jerry/public_html/lms/src/libs/utils/include/utils/NetAddress.hpp:22,
                 from /home/jerry/public_html/lms/src/libs/utils/impl/NetAddress.cpp:20:
/usr/include/boost/asio/ip/address.hpp:271:8: note: previous definition of ‘struct std::hash<boost::asio::ip::address>’
  271 | struct hash<boost::asio::ip::address>
      |        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/jerry/public_html/lms/src/libs/utils/impl/NetAddress.cpp:24:21: error: redefinition of ‘std::size_t std::hash<boost::asio::ip::address>::operator()(const boost::asio::ip::address&) const’
   24 |         std::size_t hash<boost::asio::ip::address>::operator()(const boost::asio::ip::address& ipAddr) const
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/jerry/public_html/lms/src/libs/utils/include/utils/NetAddress.hpp:22,
                 from /home/jerry/public_html/lms/src/libs/utils/impl/NetAddress.cpp:20:
/usr/include/boost/asio/ip/address.hpp:273:15: note: ‘std::size_t std::hash<boost::asio::ip::address>::operator()(const boost::asio::ip::address&) const’ previously defined here
  273 |   std::size_t operator()(const boost::asio::ip::address& addr)
      |               ^~~~~~~~
make[2]: *** [src/libs/utils/CMakeFiles/lmsutils.dir/build.make:160: src/libs/utils/CMakeFiles/lmsutils.dir/impl/NetAddress.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1515: src/libs/utils/CMakeFiles/lmsutils.dir/all] Error 2
make: *** [Makefile:146: all] Error 2

Maybe conflicting to the boost package?

@epoupon
Copy link
Owner

epoupon commented Aug 8, 2021

Hi !
Thanks for reporting this!

@epoupon epoupon added this to the v3.27.0 milestone Aug 8, 2021
@epoupon
Copy link
Owner

epoupon commented Aug 15, 2021

Ok, got it:
image
Just remove/comment the whole NetAddress.hpp/cpp to move on, I will skip this for asio version < 1.76

@epoupon
Copy link
Owner

epoupon commented Aug 15, 2021

otherwise just cherry pick 7d0dae1

@protozis
Copy link
Author

Nice! Thanks for the support.

@epoupon epoupon closed this as completed Aug 16, 2021
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