当前位置:网站首页>Qt中文编程遇C2001错误,提示“常量中有换行符”
Qt中文编程遇C2001错误,提示“常量中有换行符”
2022-07-25 22:40:00 【物随心转】
一、问题
QT上用MSVC去编译部分含有中文的字符串时会出现编译错误error: C2001: 常量中有换行符
二、解决方案
解决方法:
1、设置是工具->选项->文本编辑器->行为->UTF-8 BOM设置成“如果编码是UTF-8则添加”
2、在头文件或.cpp文件,加上#pragma execution_character_set("utf-8")
3、使用记事本打开文件,另存文件为带BOM头 utf-8 格式

参考:
边栏推荐
- 科大讯飞智能办公本Air电纸书阅读器,让我的工作生活更加健康
- 沃达德软件:智慧城市方案
- BIO、NIO、AIO的区别?
- ECMA 262 12 Lexical Grammer
- Today, let's talk about the if branch statement of the selection structure
- Data governance under data platform
- Simple setting of drop-down triangle
- Domain oriented model programming
- Solve several common problems
- Compiler introduction
猜你喜欢

【集训DAY12】X equation 【高精度】【数学】

谷歌分析UA怎么转最新版GA4最方便

编译器引论

Build commercial projects based on ruoyi framework

Arcgis10.2 configuring postgresql9.2 standard tutorial

【集训DAY15】油漆道路【最小生成树】

Interview question 17.11. word distance ●●
![[training day13] out race [mathematics] [dynamic planning]](/img/94/d86031a062c9311f83d63809492d71.png)
[training day13] out race [mathematics] [dynamic planning]

About vscode usage+ Solutions to the problem of tab failure

我们为什么要推出Getaverse?
随机推荐
xss-工具-Beef-Xss安装以及使用
Severely crack down on illegal we media operators according to law: it is urgent to purify the we media industry
The price of dividing gold bars
Interview question 17.11. word distance ●●
Ffmpeg plays audio and video, time_ Base solves the problem of audio synchronization and SDL renders the picture
[training Day12] min ratio [DFS] [minimum spanning tree]
The new media operation strategy (taking xiaohongshu as an example) helps you quickly master the creative method of popular models
PySpark数据分析基础:pyspark.sql.SparkSession类方法详解及操作+代码展示
英文术语对应的解释
ML-Numpy
1000个Okaleido Tiger首发上线Binance NFT,引发抢购热潮
[training day15] good name [hash]
LabVIEW 开发 PCI-1680U双端口CAN卡
平台架构搭建
QT log file system
新媒体运营策略(以小红书为例)帮助你快速掌握爆款创作方法
【集训DAY13】Travel【暴力】【动态规划】
Wechat official account application development (I)
力扣解法汇总919-完全二叉树插入器
ThreadLocal summary (to be continued)