-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Fix "undefined reference to `fmt::v7::detail::basic_data<void>::digits'" #2333
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
cmake_minimum_required(VERSION 3.1...3.18) | ||
|
||
project(fmt-link CXX) | ||
|
||
set(BUILD_SHARED_LIBS OFF) | ||
set(CMAKE_VISIBILITY_INLINES_HIDDEN TRUE) | ||
set(CMAKE_CXX_VISIBILITY_PRESET "hidden") | ||
|
||
# Broken LTO on GCC 4 | ||
if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5) | ||
set(BROKEN_LTO ON) | ||
endif () | ||
|
||
if (NOT BROKEN_LTO AND CMAKE_VERSION VERSION_GREATER "3.8") | ||
# CMake 3.9+ | ||
include(CheckIPOSupported) | ||
check_ipo_supported(RESULT HAVE_IPO) | ||
if (HAVE_IPO) | ||
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE) | ||
endif () | ||
endif () | ||
|
||
add_subdirectory(../.. fmt) | ||
set_property(TARGET fmt PROPERTY POSITION_INDEPENDENT_CODE ON) | ||
|
||
add_library(library-test SHARED library.cc) | ||
target_link_libraries(library-test PRIVATE fmt::fmt) | ||
|
||
add_executable(exe-test main.cc) | ||
target_link_libraries(exe-test PRIVATE library-test) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#include <fmt/compile.h> | ||
|
||
__attribute__((visibility("default"))) std::string foo() { | ||
return fmt::format(FMT_COMPILE("foo bar {}"), 4242); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#include <iostream> | ||
#include <string> | ||
|
||
extern std::string foo(); | ||
|
||
int main() { std::cout << foo() << std::endl; } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you remove
FMT_EXTERN_TEMPLATE_API
definition?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FMT_EXTERN_TEMPLATE_API
was added in the partial incorrect commit 13e6529 and is not used anywhere.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, "partial incorrect commit" 👎
FMT_EXTERN_TEMPLATE_API
was used before. But you're correct to note that it is not necessary anymore.