How to turn off the "This file does not belong to any target .." banner
已回答
Just upgraded to 2017.2 and now many/most of my include files have a huge yellow header telling me "This file does not belong to any target .. " banner. I'm getting this for files directly included in the main.cpp file of the current building project so they are most definitely part of the build so I don't know what heuristic is being used to work this out, but it's not working very well.
Either way it's a very annoying banner especially as it's on fully 60% of the files in my project. How can I turn it off? If I can't turn it off, how do I downgrade to 2017.1.3?
请先登录再写评论。
Unfortunately, it can't be disabled for now: https://youtrack.jetbrains.com/issue/CPP-10234. Please upvote. Previous CLion versions can be found here: https://www.jetbrains.com/clion/download/previous.html.
I don't know the answer, but I've got something to try for you.
First, build your app. Change one of the files that is not in the project. Build again.
Did the change in the changed file cause a rebuild? Or did nothing rebuild? If so, the file might be referenced by your main, but not part of your build dependencies in your cmake file. Which might be the criteria that CLion uses for whether it is a project file or not.d
If the issue in fact is that it isn't a build dependency then CLion did you a favor to prompt you to the issue.
This message went away when I added the file that was begin flagged to the CMakeLists.txt file. I'm new to CLion, so this style of make may be an optional setting. I added both .c and .h files under the add_executable(...) entry.
Try this:
File > Reload Project
Don't rename extra add_execuatble, just add it into the same add_execuatable
1. When there was just one file
2. and I wanted to add other files I did
mymalloc.c and mymalloc.h are my my helping object files
Hello everyone!
In case of CMake, CLion considers a file as included into a project when it's added to some target. As for the headers: starting from 2018.2, CLion automatically treats included files as project files. Please see this article for more detail.