Skip to content
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

spdlog/fmt/ostr.h defines FMT_HEADER_ONLY #1348

Closed
ficzerepeti opened this issue Dec 9, 2019 · 2 comments
Closed

spdlog/fmt/ostr.h defines FMT_HEADER_ONLY #1348

ficzerepeti opened this issue Dec 9, 2019 · 2 comments

Comments

@ficzerepeti
Copy link

Hi,

I'm just trying to upgrade from v1.3 to v1.4.2 with bundled FMT library.
While compiling the new version msvc compiler noticed that a method is compiled in multiple translation units. This is due to spdlog/fmt/ostr.h defining FMT_HEADER_ONLY. If I include spdlog/fmt/ostr.h before all other spdlog includes then it's like I've defined FMT_HEADER_ONLY although I haven't. If it's the last include then everything is fine.

Thank you for this amazing logger btw.

(Link target) ->
 spdlog.lib(fmt.obj) : error LNK2005: "public: virtual __cdecl fmt::v6::format_error::~format_error(void)" (??1format_error@v6@fmt@@UEAA@XZ) already defined in main.obj [path_to_project.vcxproj]
 spdlog.lib(fmt.obj) : error LNK2005: "public: void __cdecl fmt::v6::internal::error_handler::on_error(char const *)" (?on_error@error_handler@internal@v6@fmt@@QEAAXPEBD@Z) already defined in main.obj [path_to_project.vcxproj]
 path_to_bin.exe : fatal error LNK1169: one or more multiply defined symbols found [path_to_project.vcxproj]

Thanks,
Peter

gabime added a commit that referenced this issue Dec 10, 2019
@gabime
Copy link
Owner

gabime commented Dec 10, 2019

@ficzerepeti I could not reproduce. But I tried to fix anyway. Please see if latest commit solves it

@ficzerepeti
Copy link
Author

I tried to create a small example too that reproduces the issue but failed to.
Good news is that your changes seem to fix the issue where it originally occurred. Thanks

@gabime gabime closed this as completed Dec 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants