CLion 报错This file does not belong to any project target,code insight features might not work pro

发现宝藏开发神器,CLion

安装之后会自己去找需要的构建工具。提前把cmake和minGW工具安装好,其他的什么都不要你操心呢。记得安装CLion的时候,勾选add to path

CLion 报错This file does not belong to any project target,code insight features might not work pro

自己新建一个C++的demo项目,运行没有任何问题,从其他地方导入就不能运行了。运行的时候需要你去配置执行文件。怎么回事呢?就是需要写CmakeLists.txt文件去配置,有几个文件就配置几个。如果出现This file does not belong to any project target,黄色的警告,把这几个文件添加进去,并且Reload cmake project就大功告成了!!!

CLion 报错This file does not belong to any project target,code insight features might not work pro