[Qt-interest] Question about "wchar_t" support on Windows

James Larcombe james.larcombe at avid.com
Thu Jan 20 17:05:20 CET 2011


Yves Bailly wrote:

> When building projects on Windows using Visual C++, I see the option
> -Zc:wchar_t- is set in QMAKE_CFLAGS in %QMAKESPEC%/qmake.conf. This
> option tells the compiler to *not* consider "wchar_t" as a native
> type, therefore it has to be defined somewhere (typically as an 
> "unsigned short"). This is for either Visual 2005, 2008 or 2010.
> 
> I couldn't find any "good" reason for this, does someone have any
hint?

Possibly because wchar_t is a different size across the various
platforms that Qt runs on (16 bits on Windows, 32 bits on Unix and Mac
OS X) and therefore using it in a Qt app without careful thought (eg. an
explicit typedef) is probably not a good idea.

James



More information about the Qt-interest-old mailing list