QT: MinGW to MSVC compile error: "newline character in constant", etc.

QT: MinGW to MSVC compile error: "newline character in constant", etc.
Solutions:
1. Tools-Options-Text Editor: The default encoding is UTF-8; BOM: If the encoding is UTF-8, add it.
2. Add the following code to the header file and source file:

#if _MSC_VER >=1600    // MSVC2015>1899,对于MSVC2010以上版本都可以使用
#pragma execution_character_set("utf-8")
#endif

3. Recompile

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324141052&siteId=291194637