The technical reason is that in VS2008 and VS2010, new applications used the compiler flag "Treat wchar_t as a built in type" with the value "No" ("/Zc:wchar_t-"), whereas the Qt distribution was built with the opposite setting ("/Zc:wchar_t"). The compiler didn't know anything was wrong, nor did the linker. It wasn't until runtime that crashes would occur.
The workaround for VS2010 was to either rebuild the Qt binaries as suggested, or to change the project settings to reverse the flag. Changing the project settings also means that any other external libraries that use wchar_t also have to be built the same way.
In current releases of Visual Studio (and Qt pre-built binaries), the default setting is now "Yes" ("/Zc:wchar_t") everywhere so everything is compatible.
<=== The Great Pumpkin says ===>
Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.
Bookmarks