当前位置:网站首页>【CLion】CLion 总是提示 “This file does not belong to any project target xxx” 的解决方法
【CLion】CLion 总是提示 “This file does not belong to any project target xxx” 的解决方法
2022-08-01 10:57:00 【unonoi】
参考:In IntelliJ, How Do I Fix “These Files Do Not Belong to the Project”?
在使用 CLion 写 c++ 时,文件上方提示 “This file does not belong to any project target xxx” 时,可如下操作:
- 如果是头文件:如果该头文件没有被其他文件引用,则会显示此提示,所以需要在其他地方引用该头文件。
- 如果是源文件:如果该源文件没有被添加到 CMakeLists.txt 文件中,则会显示此提示,所以需要将此文件添加到 CMakeList 中,然后删除 cmake 缓存并重新
Reload CMake Project
。 - 如果是新增加到项目中的头/源文件:原因是 cmake 缓存中没有将新增文件添加到构建命令中,解决方法与 1、2 相同。
但是在我的项目中,出现了不属于上述任何情况但是文件上方仍然提示 “This file does not belong to any project target xxx” 的问题,最终研究一番后这样解决:
菜单栏 File -> Invalidate Caches… -> Invalidate and Restart.
CLion 重启后不再提示。
边栏推荐
猜你喜欢
jmeter
图解MySQL内连接、外连接、左连接、右连接、全连接......太多了
Endorsed in 2022 years inventory | product base, science and technology, guangzhou automobile group striding forward
表达式引擎在转转平台的实践
Mini Program Graduation Works WeChat Food Recipes Mini Program Graduation Design Finished Products (2) Mini Program Functions
如何从完美的智能合约中窃取 1 亿美元
爱可可AI前沿推介(8.1)
基于ArkUI eTS开发的坚果食谱(NutRecipes)
Mysql索引相关的知识复盘一
How to Steal $100 Million from the Perfect Smart Contract
随机推荐
小程序毕设作品之微信美食菜谱小程序毕业设计成品(1)开发概要
解决new Thread().Start导致高并发CPU 100%的问题
各位大拿,安装Solaris 11.4操作系统,在安装数据库依赖包的时候包这个错,目前无原厂支持,也无安装盘,联网下载后报这个错,请教怎么解决?
JWT
【无标题】
基于ModelArts的物体检测YOLOv3实践【玩转华为云】
小程序毕设作品之微信美食菜谱小程序毕业设计成品(4)开题报告
大众碰到点评的一个字体反爬,落地技术也是绝了
Dapr 与 NestJs ,实战编写一个 Pub & Sub 装饰器
C语言实现!20000用4秒计算
CTO strongly banning the use of the Calendar, that in what?
WPF 截图控件之绘制箭头(五)「仿微信」
URL.createObjectURL、URL.revokeObjectURL、Uint8Array、Blob使用详解
shell--面试题
STM32入门开发 介绍IIC总线、读写AT24C02(EEPROM)(采用模拟时序)
Online - GCeasy GC log analysis tools
For small applications, which database is better to use?
Stone Technology builds hard-core brand power and continues to expand the global market
C#/VB.NET convert PPT or PPTX to image
jmeter