You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// without this defined it does not build
#define _SILENCE_ALL_MS_EXT_DEPRECATION_WARNINGS
#include "spdlog/spdlog.h"
int main()
{
std::string a = "abc";
std::string b = "123";
spdlog::debug("a={}, b={}", a, b);
SPDLOG_DEBUG("Some debug message");
}
If I remove #define _SILENCE_ALL_MS_EXT_DEPRECATION_WARNINGS I get the following error
1>test_spdlog.cpp
1>xxx\spdlog\fmt\bundled\format.h(490,51): error C4996: 'stdext::checked_array_iterator<_Ty*>': warning STL4043: stdext::checked_array_iterator, stdext::unchecked_array_iterator, and related factory functions are non-Standard extensions and will be removed in the future. std::span (since C++20) and gsl::span can be used instead. You can define _SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING or _SILENCE_ALL_MS_EXT_DEPRECATION_WARNINGS to suppress this warning.
1>(compiling source file 'test_spdlog.cpp')
1>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\iterator(1470,1):
1>see declaration of 'stdext::checked_array_iterator'
1>xxx\spdlog\fmt\bundled\format.h(493,3): error C4996: 'stdext::checked_array_iterator<T *>::checked_array_iterator': warning STL4043: stdext::checked_array_iterator, stdext::unchecked_array_iterator, and related factory functions are non-Standard extensions and will be removed in the future. std::span (since C++20) and gsl::span can be used instead. You can define _SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING or _SILENCE_ALL_MS_EXT_DEPRECATION_WARNINGS to suppress this warning.
1>xxx\spdlog\fmt\bundled\format.h(493,3): error C4996: with
1>xxx\spdlog\fmt\bundled\format.h(493,3): error C4996: [
1>xxx\spdlog\fmt\bundled\format.h(493,3): error C4996: T=fmt::v9::detail::bigint::bigit
1>xxx\spdlog\fmt\bundled\format.h(493,3): error C4996: ]
1>(compiling source file 'test_spdlog.cpp')
1>xxx\spdlog\fmt\bundled\format.h(493,3):
1>the template instantiation context (the oldest one first) is
1> xxx\spdlog\fmt\bundled\format.h(2807,34):
1> see reference to function template instantiation 'stdext::checked_array_iterator<T *> fmt::v9::detail::make_checked<T>(T *,size_t)' being compiled
1> with
1> [
1> T=fmt::v9::detail::bigint::bigit
1> ]
I tried with all the language version C++14 to C++20. Do I use spdlog in a wrong way? I use the header only version which I cloned directly from Github.
The text was updated successfully, but these errors were encountered:
Duplicate #2987 and already fixed fmtlib/fmt#3540.
If you define _SILENCE_ALL_MS_EXT_DEPRECATION_WARNINGS, you should also define CMake variable SPDLOG_FMT_EXTERNAL and use external fmt.
I wonder what is wrong here
If I remove
#define _SILENCE_ALL_MS_EXT_DEPRECATION_WARNINGS
I get the following errorI tried with all the language version C++14 to C++20. Do I use spdlog in a wrong way? I use the header only version which I cloned directly from Github.
The text was updated successfully, but these errors were encountered: