简体   繁体   中英

swprintf and vswprintf not declared?

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?

Try putting in

#undef __STRICT_ANSI__ 

before including stdio.h

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;

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM