当前位置:网站首页>【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 重启后不再提示。
边栏推荐
- .NET analyzes the LINQ framework in depth (three: the elegant prelude of LINQ)
- Generate certificates using KeyStore
- Golang内存分析工具gctrace和pprof实战
- 编码解码(btoa、encodeURIComponent、encodeURI、escape)
- EasyRecovery热门免费数据检测修复软件
- 如何解决 chrome 浏览器标签过多无法查看到标题的情况
- 在线GC日志分析工具——GCeasy
- Why Metropolis–Hastings Works
- Mysql索引相关的知识复盘一
- July 31, 2022 -- Take your first steps with C# -- Use arrays and foreach statements in C# to store and iterate through sequences of data
猜你喜欢
How to Steal $100 Million from the Perfect Smart Contract
利用正则表达式的回溯实现绕过
如何解决 chrome 浏览器标签过多无法查看到标题的情况
CTFshow,命令执行:web31
WTM:ASP.NET Core快速开发利器!
Qt 支持HEIC/HEIF格式图片
PowerPC技术与市场杂谈
xss-labs靶场挑战
【随心笔记】假期快过去了,都干了点什么
Promise learning (4) The ultimate solution for asynchronous programming async + await: write asynchronous code in a synchronous way
随机推荐
Cross-domain network resource file download
cisco交换机基本配置命令(华为交换机保存命令是什么)
pve 删除虚拟机「建议收藏」
JWT
Mini Program Graduation Works WeChat Food Recipes Mini Program Graduation Design Finished Products (4) Opening Report
华硕和微星多款产品将升级英特尔Arc A380和A310显卡
Online - GCeasy GC log analysis tools
招聘随想2022
2022年7月31日--使用C#迈出第一步--使用C#中的数组和foreach语句来存储和循环访问数据序列
轮询和长轮询的区别
力扣解法汇总1374-生成每种字符都是奇数个的字符串
基于ArkUI eTS开发的坚果食谱(NutRecipes)
mysql进阶(二十二)MySQL错误之Incorrect string value中文字符输入错误问题分析
跨域网络资源文件下载
小程序毕设作品之微信美食菜谱小程序毕业设计成品(1)开发概要
DBPack SQL Tracing 功能及数据加密功能详解
.NET analyzes the LINQ framework in depth (three: the elegant prelude of LINQ)
For small applications, which database is better to use?
从零开始Blazor Server(4)--登录系统
NIO‘s Sword(思维,取模,推公式)