- 添加工具链:
Setting -> Build -> Toolchains -> + -> Visual Studio
,选择VS
根目录

-
坑点:
a)
CLion
默认文件编码utf-8
,MSVC
默认文件编码utf-8 with BOM
,导致不能编译b)
MSVC
非标准模式模式下,可能产生与c++
标准不符的行为,影响代码在不同编译器间的移植性
解决方法:通过CMake
设置MSVC
参数,使用utf-8
编码与标准模式: -DCMAKE_CXX_FLAGS="/utf-8 /permissive-"
