-
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
Conflict with Boost.Asio on Windows #1663
Comments
This is the root cause of the Workaround: Refer: c - Cannot include both files (WinSock2, Windows.h) - Stack Overflow |
Strange that it appears in 1.8.0 though.. Are you using the bundled fmt version 7.0.3? There was a fix in that version about it. Please share the compiler error output. |
I'm using v1.8.0 with bundled fmt. Investigating, I've found that problems arise when compiling with NOMINMAX defined. Source code:
Preprocessor definitions:
Compiler output:
Removing NOMIXMAX from preprocessors everything works (with only two C4996 warnings). Keeping NOMINMAX, both @tt4g solutions (swapping includes and adding WIN32_LEAN_AND_MEAN) works. |
It seems that spdlog/include/spdlog/fmt/bundled/format-inl.h Lines 25 to 36 in 4a9ccf7
This is a bit tricky. |
@gcerretani Currently I don't have a machine at hand that can do C++ development. Can you confirm that the following patch will no longer reproduce the problem? #ifdef _WIN32
# if !defined(NOMINMAX) && !defined(WIN32_LEAN_AND_MEAN)
# define NOMINMAX
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
# undef WIN32_LEAN_AND_MEAN
# undef NOMINMAX
+# elif defined(NOMINMAX) && !defined(WIN32_LEAN_AND_MEAN)
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+# undef WIN32_LEAN_AND_MEAN
# else
# include <windows.h>
# endif
# include <io.h>
#endif |
@tt4g Good catch. Seems you are right! |
That patch resolve the problem. |
@gcerretani Could you open a PR in the fmt repo to fix this? |
I think I've done it. |
Thanks. Will be updated in spdlog's copy when next official fmt is released |
I am having this problem with the latest boost release 1.80.0. I used the patch above and I'm back in business, as follows:
I will probably disappear and be unresponsive if anyone gets back to me. Just being honest. I'm not on GitHub every day... |
…age and Meter::Collect (gabime#1666)
Same as issue #179, marked as fixed in 2016, but reappeared since v1.6.0.
This source code
compiles in v1.5.0, but fails since v1.6.0 with messages like
Tested up to v1.8.0 with Boost v1.67 and MSVC 1900 (2015).
The text was updated successfully, but these errors were encountered: