1. 程式人生 > >CLion This file does not belong to any project target, code insight

CLion This file does not belong to any project target, code insight

CLion This file does not belong to any project target, code insight features might not work properly.
我新建了一個名稱為“haha.c”的檔案
然後CLion提示上圖所示的

解決方法有兩個:
1.左面New新建時不要選擇File或者New Scratch File
2.如果已經建好了,那麼就在CMakeLists.txt檔案中加入你所新建的檔名

在這裡插入圖片描述

然後 Reload changes 就好啦