You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/usr/bin/ld: /tmp/ccQQn4MB.o: in function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > fmt::v6::format<char [17], int, char>(char const (&) [17], int&&)':
fmt_test.cpp:(.text._ZN3fmt2v66formatIA17_cJiEcEENSt7__cxx1112basic_stringIT1_St11char_traitsIS5_ESaIS5_EEERKT_DpOT0_[_ZN3fmt2v66formatIA17_cJiEcEENSt7__cxx1112basic_stringIT1_St11char_traitsIS5_ESaIS5_EEERKT_DpOT0_]+0x70): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > fmt::v6::internal::vformat<char>(fmt::v6::basic_string_view<char>, fmt::v6::basic_format_args<fmt::v6::basic_format_context<std::back_insert_iterator<fmt::v6::internal::buffer<char> >, char> >)'
collect2: error: ld returned 1 exit status
Shouldn't this compile?
If format.h is included instead core.h, it works.
I'm trying to include only core.h, to see if I can reduce executable size.
According to benchmarks executable should be smaller than tinyformat, but it's opposite.
The text was updated successfully, but these errors were encountered:
No. Use fmt/format.h instead of fmt/core.h in the header-only mode. I clarified this in the docs: fe642d7.
Compiling in the header mode may also pull in unnecessary symbols, so I recommend building with the static library instead, possibly even with LTO. Note that the benchmark compares per-call code bloat, not fixed library sizes. I don't know how the library sizes compare.
The {fmt} library size is ~200-300kiB (depends on the system) although there were reports of people being able to bring it down significantly on embedded platforms.
When building with FMT_HEADER_ONLY and including fmt/core.h.
gcc version 9.2.0
$ cat fmt_test.cpp
$ g++ -o fmt_test -DFMT_HEADER_ONLY -I./include fmt_test.cpp
Shouldn't this compile?
If format.h is included instead core.h, it works.
I'm trying to include only core.h, to see if I can reduce executable size.
According to benchmarks executable should be smaller than tinyformat, but it's opposite.
The text was updated successfully, but these errors were encountered: