Regarding Qt switching from Qt5.9 to Qt5.12 when Windows uses the mingw32 compiler, the solution to "C2001: There is a newline character in the constant" without modifying the encoding

If the article is an original article, please indicate the source of the original article when reprinting.
The blog address of this article: https://hpzwl.blog.csdn.net/article/details/131901444

Red Fatty (Red Imitation)'s Blog Encyclopedia: Development technology collection (including Qt practical technology, Raspberry Pi, 3D, OpenCV, OpenGL, ffmpeg, OSG, single-chip microcomputer, combination of software and hardware, etc.) is continuously being updated... (click on the portal)

Qt development column: various problem solving (click on the portal)


question

  The R&D project first uses Qt5.9.3 mingw32 and needs to switch to the mingw64 version of Qt5.12.7. In theory, they are all mingw32-type compilers, and there will be no newline problems like msvc, but in fact it does.
  insert image description here


Solution

  Modify the text encoding first:
  insert image description here

  At this time, it still doesn't work. You need to modify each file that is wrong (modify it to save it again, for example, just type a space and delete it. Then compile and pass
  :
  insert image description here

  (PS: Errors are reported for multiple files, each file has to be operated once), no need to modify any codes and set encoding codes, etc.


If the article is an original article, please indicate the source of the original article when reprinting.
The blog address of this article: https://hpzwl.blog.csdn.net/article/details/131901444

Guess you like

Origin blog.csdn.net/qq21497936/article/details/131901444