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 fails for latest xcode on macos #117

Open
psifertex opened this issue Sep 26, 2023 · 2 comments
Open

build fails for latest xcode on macos #117

psifertex opened this issue Sep 26, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@psifertex
Copy link

psifertex commented Sep 26, 2023

/Users/jwiens/Downloads/binexport/third_party/boost_parts/boost/container_hash/hash.hpp:130:33: error: no template named 'unary_function' in namespace 'std'; did you mean '__unary_function'?
        struct hash_base : std::unary_function<T, std::size_t> {};
                           ~~~~~^~~~~~~~~~~~~~
                                __unary_function
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/include/c++/v1/__functional/unary_function.h:46:1: note: '__unary_function' declared here
using __unary_function = __unary_function_keep_layout_base<_Arg, _Result>;
^
1 error generated.

I assume there's a newer boost that fixes it or just running the update boost script would, but in the meantime, simply following the suggestion works.

diff --git a/third_party/boost_parts/boost/container_hash/hash.hpp b/third_party/boost_parts/boost/container_hash/hash.hpp
index 76de793..32f0559 100644
--- a/third_party/boost_parts/boost/container_hash/hash.hpp
+++ b/third_party/boost_parts/boost/container_hash/hash.hpp
@@ -127,7 +127,7 @@ namespace boost
         };
 #else
         template <typename T>
-        struct hash_base : std::unary_function<T, std::size_t> {};
+        struct hash_base : std::__unary_function<T, std::size_t> {};
 #endif

         struct enable_hash_value { typedef std::size_t type; };
@psifertex
Copy link
Author

@withzombies points out you can also just build with:

-DCMAKE_CXX_FLAGS="-D_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION"

@cblichmann
Copy link
Member

Is this still a problem? I upgraded Boost to 1.83 in 840ddee

@cblichmann cblichmann added the bug Something isn't working label Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants