davidgiven / fluxengine

PSOC5 floppy disk imaging interface
MIT License
356 stars 68 forks source link

Formattable issue when building on OSX #693

Closed aizuchi0 closed 1 year ago

aizuchi0 commented 1 year ago

Formattable error when compiling, on both master and protobuf branches. Using gcc/g++-13 from homebrew:

CFLAGS="-I/opt/homebrew/include/" LDFLAGS="-L/opt/homebrew/lib/" CC="/opt/homebrew/bin/gcc-13" CXX="/opt/homebrew/bin/g++-13" gmake CXX lib/fl2.cc In file included from /opt/homebrew/include/fmt/format.h:49, from lib/globals.h:18, from lib/fl2.cc:1: /opt/homebrew/include/fmt/core.h: In instantiation of 'constexpr fmt::v10::detail::value fmt::v10::detail::make_value(T&&) [with Context = fmt::v10::basic_format_context<fmt::v10::appender, char>; T = const FluxFileVersion&]': /opt/homebrew/include/fmt/core.h:1711:29: required from 'constexpr fmt::v10::detail::value fmt::v10::detail::make_arg(T&&) [with bool IS_PACKED = true; Context = fmt::v10::basic_format_context<fmt::v10::appender, char>; type = fmt::v10::detail::type::custom_type; T = const FluxFileVersion&; typename std::enable_if<IS_PACKED, int>::type = 0]' /opt/homebrew/include/fmt/core.h:1827:77: required from 'constexpr fmt::v10::format_arg_store<Context, Args>::format_arg_store(T&& ...) [with T = {const FluxFileVersion&, const FluxFileVersion&}; Context = fmt::v10::basic_format_context<fmt::v10::appender, char>; Args = {FluxFileVersion, FluxFileVersion}]' /opt/homebrew/include/fmt/core.h:1844:31: required from 'constexpr fmt::v10::format_arg_store<Context, typename std::remove_cv<typename std::remove_reference::type>::type ...> fmt::v10::make_format_args(T&& ...) [with Context = basic_format_context<appender, char>; T = {const FluxFileVersion&, const FluxFileVersion&}]' /opt/homebrew/include/fmt/core.h:2817:44: required from 'std::string fmt::v10::format(format_string<T ...>, T&& ...) [with T = {const FluxFileVersion&, const FluxFileVersion&}; std::string = std::__cxx11::basic_string; format_string<T ...> = basic_format_string<char, const FluxFileVersion&, const FluxFileVersion&>]' lib/globals.h:50:37: required from 'void error(fmt::v10::string_view, const Args& ...) [with Args = {FluxFileVersion, FluxFileVersion}; fmt::v10::string_view = fmt::v10::basic_string_view]' lib/fl2.cc:30:14: required from here /opt/homebrew/include/fmt/core.h:1691:7: error: static assertion failed: Cannot format an argument. To make type T formattable provide a formatter specialization: https://fmt.dev/latest/api.html#udt 1691 | formattable, | ^~~ /opt/homebrew/include/fmt/core.h:1691:7: note: 'formattable' evaluates to false

and using clang++:

CFLAGS="-I/opt/homebrew/include/" LDFLAGS="-L/opt/homebrew/lib/" gmake CXX lib/fl2.cc In file included from lib/fl2.cc:1: In file included from lib/globals.h:18: In file included from /opt/homebrew/include/fmt/format.h:49: /opt/homebrew/include/fmt/core.h:1690:3: error: static_assert failed due to requirement 'formattable' "Cannot format an argument. To make type T formattable provide a formatter specialization: https://fmt.dev/latest/api.html#udt" static_assert( ^ /opt/homebrew/include/fmt/core.h:1711:10: note: in instantiation of function template specialization 'fmt::detail::make_value<fmt::basic_format_context<fmt::appender, char>, const FluxFileVersion &>' requested here return make_value(val); ^ /opt/homebrew/include/fmt/core.h:1825:23: note: in instantiation of function template specialization 'fmt::detail::make_arg<true, fmt::basic_format_context<fmt::appender, char>, fmt::detail::type::customtype, const FluxFileVersion &, 0>' requested here data{detail::make_arg< ^ /opt/homebrew/include/fmt/core.h:1844:10: note: in instantiation of function template specialization 'fmt::format_arg_store<fmt::basic_format_context<fmt::appender, char>, FluxFileVersion, FluxFileVersion>::format_arg_store<const FluxFileVersion &, const FluxFileVersion &>' requested here return {FMT_FORWARD(args)...}; ^ /opt/homebrew/include/fmt/core.h:2817:28: note: in instantiation of function template specialization 'fmt::make_format_args<fmt::basic_format_context<fmt::appender, char>, const FluxFileVersion &, const FluxFileVersion &>' requested here return vformat(fmt, fmt::make_format_args(args...)); ^ lib/globals.h:50:31: note: in instantiation of function template specialization 'fmt::format<const FluxFileVersion &, const FluxFileVersion &>' requested here throw ErrorException{fmt::format(fstr, args...)}; ^ lib/fl2.cc:30:9: note: in instantiation of function template specialization 'error<FluxFileVersion, FluxFileVersion>' requested here error( ^ 1 error generated. gmake: *** [Makefile:271: .obj/lib/fl2.o] Error 1

davidgiven commented 1 year ago

Yup, just looking into this now. Seems that Homebrew has upgraded to a version of libfmt which is Opinionated.

See: #692

aizuchi0 commented 1 year ago

TYSM!