当前位置:网站首页>Error message of "this file does not be long to any project, code insight features might not work properly" in clion
Error message of "this file does not be long to any project, code insight features might not work properly" in clion
2022-04-22 01:16:00 【Su moling】
Write it at the front : During scientific research, due to the needs of the project , You need to download Mr. Li Ping's about IDMA A paper on , By the way, download the open source simulation package , Then build the system locally for data simulation .

After downloading, unzip and get multiple files , It includes two .cpp Documents and a .h file . stay CLion Create a new one in Project, Then add three files to the project , An error is reported when clicking run :

Find out function EnergyProfile( ) Call failed , The function is defined in the header file energy.cpp in , stay energy.cpp The following errors are reported in the :

intend : This file does not belong to any project , Code functions may not work properly
This is because the header file is not linked to the whole project , as everyone knows ,C Language or C++ The source program of the language must be compiled and linked before it can become a binary executable file that can be processed by the computer . among , Compilation refers to the program based on the source code written by the user , High level language ( such as C Language ) Into assembly code that can be read by computer , This step is usually done by the compiler ; Link refers to , After compilation, an object file will be generated , This object file may call some functions ( such as printf function ), Its object code is in the function library of the system , All the link has to do is combine the code in these function libraries into the target file .
simply , That means you have to communicate with a foreigner , At this time, you have to translate the spoken Chinese into English , Like compiling , Then some words may not be well understood. You need to look up the dictionary to translate accurately , Carrying an English Chinese dictionary with you is like a link .
therefore —— The solution is , stay CMakeLists.txt Of add_executable Add header file to energy.cpp, Pictured :

And then run the program , solve the problem :

Postscript : This example is .cpp Documents are C++ Code , Same thing ,C In language .c The link to the file is the same as in this example . Last , I wish you didn't write the code bug!!!
版权声明
本文为[Su moling]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204220035502134.html
边栏推荐
- 括号匹配检测 (20 分) C语言
- Use of Prometheus
- Ma Qianli, vice president of Babbitt: the rise of NPC in the era of meta universe, digital identity protocol may become an import-level product - 2022 yuan universe cloud Summit
- 2022年Redis最新面试题第1篇 - Redis基础知识
- How can zhiting connect Huawei smart speakers?
- Qipengyuan vision breaks the conventional social model and constructs a diversified scene community
- It's enough to study butterfly theme beautification
- 精彩回顾 | DEEPNOVA x Iceberg Meetup Online《基于Iceberg打造实时数据湖》
- 观测云登陆阿里云计算巢,共建ISV新生态
- From the perspective of source code, what are the ways to create thread pool
猜你喜欢

How can zhiting connect Huawei smart speakers?

MySQL进阶之常用函数

Cloud native enthusiast weekly: looking for open source alternatives to netlify

腾讯T3团队整理,被逼无奈开始狂啃底层技术

EventBridge 集成云服务实践
腾讯字节等大厂面试真题汇总,Android程序员怎么优雅迈过30K 这道坎

在setTimeout里设置倒数5秒计时的方法

Probe architecture of open source project kindling based on ebpf Technology
![[知识图谱] Tushare数据获取和展示(1/*)](/img/c7/52fefae0cb0e8a7a2a22854521b880.png)
[知识图谱] Tushare数据获取和展示(1/*)

想要加盟智能家居,你需要了解些什么?
随机推荐
How to select Bi tools? These three questions are the key!
MySQL进阶之常用函数
On software development skills of swen2003
A simple and easy-to-use file upload scheme
Qipengyuan vision breaks the conventional social model and constructs a diversified scene community
MySQL advanced common functions
Is it reliable for Huishang futures to open an account? Is it safe?
Boutique: thousand word long text hand-in-hand teaches you to use the byte beating volcanic engine veimagex
《Vite学习指南---基于腾讯云Webify部署项目》视频课程上线“云+社区”
Apachecon Asia 2022 speech collection begins!
ZGC garbage collector for JVM from getting started to giving up
I use ehcache to improve the query performance by 100 times. It's really fragrant
【ACM/webank】#491. Incremental subsequence (use HashSet to record and prevent repeated subsequences)
Solve the problem that the idea web project does not have small blue dots
2022年4月21日,第14天
How to use the drawing board to draw the structure diagram easily?
[zeele_tech] Introduction to ROS / ROS 2
[audio and video] RTCP
No more simple intention lock
闭包的原理及应用