swprintf and vswprintf not declared?

烂漫一生 提交于 2019-11-28 07:16:28

问题


I am trying to compile Botan on Windows with MinGW, and am receiving the following error during compilation:

c:\qt\2010.04\mingw\bin\../lib/gcc/mingw32/4.4.0/include/c++/cwchar:159: error:
'::swprintf' has not been declared
c:\qt\2010.04\mingw\bin\../lib/gcc/mingw32/4.4.0/include/c++/cwchar:166: error:
'::vswprintf' has not been declared

Why are swprintf and vswprintf not declared, and how can I fix this?


回答1:


Try putting in

#undef __STRICT_ANSI__ 

before including stdio.h




回答2:


had the same problem compiling Grantlee using MinGW (Qt 2010.05).

How I got it to compile:

  • find file cwchar (C:\Qt\2010.05\mingw\lib\gcc\mingw32\4.4.0\include\c++\cwchar)
  • comment the following lines out (around line 160)

    using ::swprintf;

    using ::vswprintf;




回答3:


When running make ensure that -ansi flag is not set. If this flag is being used then remove it and the problem will be solved.



来源:https://stackoverflow.com/questions/3445312/swprintf-and-vswprintf-not-declared

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!