Created attachment 864586 [details, diff] Prepends __ to allow successful build. Building inkscape (1.2.2 and -r4) with clang-16 fails with errors about usage of std::{u,bi}nary_function: /var/tmp/portage/media-gfx/inkscape-1.2.2/work/inkscape-1.2.2/src/util/units.h:29:42: error: no template named 'unary_function' in namespace 'std'; did you mean '__unary_function'? struct hash<Glib::ustring> : public std::unary_function<Glib::ustring, std::size_t> { ~~~~~^~~~~~~~~~~~~~ __unary_function /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>; See url for a commit that removes 'almost all' usages of std::unary_function. The attached patch is just a cheeky sed that replaces these with the double-underscored names. This is obviously not a long-term solution but it enables a successful, working build. The proper fix would be to complete the work started in the linked commit.
I don't see a build log with your flags. I've also run into this issue. I'm guessing you're either passing -stdlib=libc++ or you have clang-common[default-libcxx] set. A dead giveaway is that the files failing to compile are .cpp files. Seems to be a problem with Inkscape and libc++. Adding -stdlib=libstc++ to my flags allows Inkscape to compile, but the final link fails from undefined symbols.
inkscape compiles with -std=c++17 and unary_function was removed in c++17. This is an inkscape and gcc bug, thanks
(In reply to Markus Peloquin from comment #2) > inkscape compiles with -std=c++17 and unary_function was removed in c++17. > This is an inkscape and gcc bug, thanks It's not necessarily a GCC bug if they want to keep it as an extension for now in gnu++17. But in any case, I'm not sure what your comment is adding here. (In reply to unhappy-ending from comment #1) > I don't see a build log with your flags. I've also run into this issue. I'm > guessing you're either passing -stdlib=libc++ or you have > clang-common[default-libcxx] set. A dead giveaway is that the files failing > to compile are .cpp files. Seems to be a problem with Inkscape and libc++. > Adding -stdlib=libstc++ to my flags allows Inkscape to compile, but the > final link fails from undefined symbols. Yes, you can't mix libstdc++ and libc++ (as you know well). It's clear frmo the log that the report is using libc++, but it's not blocking the bug 836220 tracker (added now).
The commit that fixes this properly has been merged upstream as of inkscape 1.3. I just confirmed media-gfx/inkscape-1.3.2 builds fine for me (still on default-libcxx), so this bug is obsolete pending stabilisation of inkscape-1.3*.