-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
new Visual Studio v16.10 breaks existing spdlog library #1955
Comments
Was the error reported when you built your project? |
It seems that already fixed fmtlib/fmt#2295. |
<format> is now part of VS 16.10 |
Hi, I am quite newbie so please take this into account while reading my comment. I am experiencing and suffering form this issue on my own project. As far as I understand the closest solution is to include the latest fix (fmtlib/fmt#2295) of the fmt library into spdlog. Is this correct? Do you have any other suggestions? |
@janclod Please replace the bundled fmt yourself. Another way is to build fmt as an external library, and set the CMake variable Lines 176 to 196 in 100f300
|
Hi tt4g, thanks for your reply. I believe that I tried something like this here: https://github.com/janclod/spdlog/tree/v1.8.1-alfa. Is this what you mean? Simply copy-pasting the files from the fmt project into the bundled folder? |
@janclod Right, you need to replace the fmt source with the latest version. |
@tt4g thanks, I will give it a try :) |
@tt4g I do get an error when building
|
@janclod This is known issue, fmt API has been changed in the latest release. And you can fix it with the following changes.
SPDLOG_INLINE spdlog_ex::spdlog_ex(const std::string &msg, int last_errno)
{
memory_buf_t outbuf;
- fmt::format_system_error(outbuf, last_errno, msg);
+ fmt::format_system_error(outbuf, last_errno, msg.c_str());
msg_ = fmt::to_string(outbuf);
} |
@tt4g thanks again for pointing me in the right direction, I am still getting more errors, I will first try to go through them myself and come back here if I need help. |
@tt4g I am totally lost due to my lack of knowledge in C++, would you be able to help further?
|
@janclod |
@tt4g it looks like the |
@janclod Sorry, I checked the fmt repository and it seems that After copying Example: // Copyright here!
#ifndef SPDLOG_COMPILED_LIB
#error Please define SPDLOG_COMPILED_LIB to compile this file.
#endif
#if !defined(SPDLOG_FMT_EXTERNAL)
#include <spdlog/fmt/bundled/format-inl.h>
// `src/format.cc` contents here!
#endif // !SPDLOG_FMT_EXTERNAL |
@tt4g no worries, you have been very helpful :) I manage to build successfully! :D |
@tt4g if I can contribute in any way, please let me know. I thought that it could be helpful to have my fork available for people facing this issue, maybe as a sort of temporary fix? |
@janclod When the next version of fmt is released, you can create a pull request (close #1941) to replace the fmt that spdlog bundles with the latest version. Unfortunately, fmt has not been released since version 7.1.3 (which is the version that spdlog is bundled with), so you won't be able to create a pull request for a while. |
I have spdlog version 1.8.1
I made the mistake of upgrading from Visual Studio 16.9 to 16.10, and it broke my code. I get errors from spdlog library.
Any idea how I can get around this issue?
The text was updated successfully, but these errors were encountered: