[{"createTime":1735734952000,"id":1,"img":"hwy_ms_500_252.jpeg","link":"https://activity.huaweicloud.com/cps.html?fromacct=261f35b6-af54-4511-a2ca-910fa15905d1&utm_source=V1g3MDY4NTY=&utm_medium=cps&utm_campaign=201905","name":"华为云秒杀","status":9,"txt":"华为云38元秒杀","type":1,"updateTime":1735747411000,"userId":3},{"createTime":1736173885000,"id":2,"img":"txy_480_300.png","link":"https://cloud.tencent.com/act/cps/redirect?redirect=1077&cps_key=edb15096bfff75effaaa8c8bb66138bd&from=console","name":"腾讯云秒杀","status":9,"txt":"腾讯云限量秒杀","type":1,"updateTime":1736173885000,"userId":3},{"createTime":1736177492000,"id":3,"img":"aly_251_140.png","link":"https://www.aliyun.com/minisite/goods?userCode=pwp8kmv3","memo":"","name":"阿里云","status":9,"txt":"阿里云2折起","type":1,"updateTime":1736177492000,"userId":3},{"createTime":1735660800000,"id":4,"img":"vultr_560_300.png","link":"https://www.vultr.com/?ref=9603742-8H","name":"Vultr","status":9,"txt":"Vultr送$100","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":5,"img":"jdy_663_320.jpg","link":"https://3.cn/2ay1-e5t","name":"京东云","status":9,"txt":"京东云特惠专区","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":6,"img":"new_ads.png","link":"https://www.iodraw.com/ads","name":"发布广告","status":9,"txt":"发布广告","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":7,"img":"yun_910_50.png","link":"https://activity.huaweicloud.com/discount_area_v5/index.html?fromacct=261f35b6-af54-4511-a2ca-910fa15905d1&utm_source=aXhpYW95YW5nOA===&utm_medium=cps&utm_campaign=201905","name":"底部","status":9,"txt":"高性能云服务器2折起","type":2,"updateTime":1735660800000,"userId":3}]
新手踩坑:刚接触CLion的小伙伴创建项目时遇到CMake project is not loaded的错误提示,该如何去解决呢?
<>一、MinGw安装目录与环境变量配置
首先,我们要确保MinGW的安装路径不含有中文,建议直接放到 D:\mingw64
这种D盘的根目录下,没有添加到环境变量的,需要在系统高级设置中添加path。
博主这里自己单独安装了CMake,完整安装了MinGW的不需要再次安装。记得CMake的安装路径也不能含有中文,安装时可勾选添加到Path就不需要自己手动添加了。
<>二、查看CLion编译器配置是否正确
选择正确的MinGW位置,CLion就会自动填充其他工具的绝对路径,成功后会打钩。
<>三、项目创建路径问题
划重点了嗷,项目创建的绝对路径中也不能含有中文,木有办法,MinGW与CMake不支持中文路径,中文乱码无法识别,CMake便无法配置。如果觉得不方便,可以将文件夹创建桌面快捷方式。
<>四、打开别人的项目出现此错误提示
出现这种问题,建议小白们重新构建一个项目,将原项目代码直接复制过来,因为重新建立项目会自动配置CMake,这是最简单的方法。
<>五、CMakeLists.txt配置
这个一般是自动配置,可查看是否正确并手动配置
# 声明要求的cmake最低版本 cmake_minimum_required(VERSION 3.15) # 声明一个cmake工程 project(
study) # C++编译器 set(CMAKE_CXX_STANDARD 14) # 可执行文件生成 add_executable(study main.
cpp)
<>六、新建立C/C++文件是否声明到CMakeLists
<>七、其他
博主想用CLion是因为UI好看,可当自己配置起来的时候十分麻烦,踩了不少的坑,并且还不能有任何的中文路径,学习过程中需要输出中文,还要改utf-8编码与GBK编码,很是麻烦。如果不是专业人士的话,还是建议大家使用CodeBlocks,最近CodeBlocks更新到20.03,整体的UI设计也很好看了,并且不需要过多的配置,错误提示一目了然。