当前位置:网站首页>解决“C2001:常量中有换行符“编译问题
解决“C2001:常量中有换行符“编译问题
2022-07-06 04:11:00 【sanqima】
用Virsual Studio编译代码时,有时会出现"C2001:常量中有换行符"问题,出现这种现象的原因是当前编码是"UTF-8不带BOM",要改成"UTF-8带BOM"类型才编译OK。点击VS菜单栏上的【文件】–》高级 --》选中"UTF-8 带BOM" --》OK,如图(1)、图(2)所示。
![](http://img.inotgo.com/imagesLocal/202207/06/202207060410584210_1.png)
![](http://img.inotgo.com/imagesLocal/202207/06/202207060410584210_2.png)
这里介绍一个批量给UTF-8源代码,添加BOM的工具:UltraCodingSwitch.exe,比如,要给source\i18n\文件夹下的*.cpp、*.h文件,都加上BOM。
1 批量给.cpp文件加上BOM
![](http://img.inotgo.com/imagesLocal/202207/06/202207060410584210_3.png)
2 批量给.h文件加上BOM
![](http://img.inotgo.com/imagesLocal/202207/06/202207060410584210_0.png)
参考文献
边栏推荐
- How to solve the problem of slow downloading from foreign NPM official servers—— Teach you two ways to switch to Taobao NPM image server
- MySQL master-slave replication
- Leetcode32 longest valid bracket (dynamic programming difficult problem)
- Global and Chinese market of plasma separator 2022-2028: Research Report on technology, participants, trends, market size and share
- QML和QWidget混合开发(初探)
- P7735-[noi2021] heavy and heavy edges [tree chain dissection, line segment tree]
- Chinese brand hybrid technology: there is no best technical route, only better products
- ESP32(基于Arduino)连接EMQX的Mqtt服务器上传信息与命令控制
- Hashcode and equals
- Python book learning notes - Chapter 09 section 01 create and use classes
猜你喜欢
Mysql数据库慢sql抓取与分析
Benefits of automated testing
DM8 backup set deletion
Facebook and other large companies have leaked more than one billion user data, and it is time to pay attention to did
lora网关以太网传输
P7735-[noi2021] heavy and heavy edges [tree chain dissection, line segment tree]
Proof of Stirling formula
Practical development of member management applet 06 introduction to life cycle function and user-defined method
Plus d'un milliard d'utilisateurs de grandes entreprises comme Facebook ont été compromis, il est temps de se concentrer sur le did
查询mysql数据库中各表记录数大小
随机推荐
【leetcode】22. bracket-generating
[Key shake elimination] development of key shake elimination module based on FPGA
Facebook and other large companies have leaked more than one billion user data, and it is time to pay attention to did
Several important classes in unity
Global and Chinese markets for patent hole oval devices 2022-2028: Research Report on technology, participants, trends, market size and share
How does technology have the ability to solve problems perfectly
IDEA编译JSP页面生成的class文件路径
Interface idempotency
About some basic DP -- those things about coins (the basic introduction of DP)
Database, relational database and NoSQL non relational database
Oracle ORA error message
P2648 make money
[001] [stm32] how to download STM32 original factory data
Exchange bottles (graph theory + thinking)
【按键消抖】基于FPGA的按键消抖模块开发
Data processing methods - smote series and adasyn
Overturn your cognition? The nature of get and post requests
PTA tiantisai l1-078 teacher Ji's return (15 points) detailed explanation
1291_ Add timestamp function in xshell log
2/13 qaq~~ greed + binary prefix sum + number theory (find the greatest common factor of multiple numbers)