先看整张图:
文件页面头部This file does not belong to any project target, code insight features might not work properly

看几个点:
1、最直观的slamBase.h头文件的文本编辑页面上方有:
This file does not belong to any project target, code insight features might not work properly
警告提示。
2、左边目录树中,include文件夹和其中的头文件slamBase.h文件都是灰色的。
3、而src文件夹和其中的文件都是彩色的。

找到如下解决方案:
https://stackoverflow.com/questions/46245738/in-clion-header-only-library-file-does-not-belong-to-any-project-target-code

原因可能就是没有关联include文件夹。

右键点击include文件夹,选择Mark Directotry as,然后选择Project Sources and Headers:
文件页面头部This file does not belong to any project target, code insight features might not work properly

然后报警就没有了,include文件夹和slamBase.h文件也被点亮了:
文件页面头部This file does not belong to any project target, code insight features might not work properly

相关文章:

  • 2021-08-08
  • 2021-09-26
  • 2022-12-23
  • 2021-08-21
  • 2022-12-23
  • 2022-12-23
  • 2021-12-30
  • 2021-07-06
猜你喜欢
  • 2021-10-05
  • 2021-05-17
  • 2021-07-25
  • 2022-01-07
  • 2022-12-23
  • 2021-09-09
相关资源
相似解决方案