(C++) ::swprintf has not been declared
February 24, 2017 · View on GitHub
(C++) ::swprintf has not been declared


::swprintf has not been declared is a compile error I encountered when using Qt Creator under Windows 7.
Solution
Add the following statement before the first #include:
#undef __STRICT_ANSI__
Or more portable:
#ifdef _WIN32 #undef __STRICT_ANSI__ #endif