Skip to content

Commit

Permalink
Fix "undefined reference to `fmt::v7::detail::basic_data<void>::digits'"
Browse files Browse the repository at this point in the history
  • Loading branch information
phprus committed Jun 1, 2021
1 parent d7ba6c3 commit ecb71cc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions include/fmt/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,10 @@
# endif
#else
# define FMT_CLASS_API
# if defined(__GNUC__) || defined(__clang__)
# define FMT_API __attribute__((visibility("default")))
# define FMT_EXTERN_TEMPLATE_API FMT_API
# if defined(FMT_EXPORT) || defined(FMT_SHARED)
# if defined(__GNUC__) || defined(__clang__)
# define FMT_API __attribute__((visibility("default")))
# endif
# endif
#endif
#ifndef FMT_API
Expand Down
2 changes: 1 addition & 1 deletion include/fmt/format.h
Original file line number Diff line number Diff line change
Expand Up @@ -903,7 +903,7 @@ template <typename T = void> struct basic_data {
FMT_API static constexpr const char right_padding_shifts[] = {0, 31, 0, 1, 0};
};

#ifndef FMT_HEADER_ONLY
#if defined(FMT_EXPORT) || defined(FMT_SHARED)
// Required for -flto, -fivisibility=hidden and -shared to work
extern template struct basic_data<void>;
#endif
Expand Down

0 comments on commit ecb71cc

Please sign in to comment.