1. 程式人生 > >解決clion中the file does not belong to any project 的問題

解決clion中the file does not belong to any project 的問題

通常clion中會莫名其妙的出現這種問題,並且這會導致程式無法正常執行,我看過網上很多方法,但可能都不太適用。今天我想介紹一下一個簡單的方法。


這時開啟你的cmakelists.txt,

一開始會出現這種狀況(假設我建立了一個template_1.h的檔案)

cmake_minimum_required(VERSION 3.10)
project(project1)

set(CMAKE_CXX_STANDARD 11)

add_executable(project1 main.cpp )

那你現在要做的就是輸入一些程式碼

cmake_minimum_required(VERSION 3.10)
project(project1)

set(CMAKE_CXX_STANDARD 11)

add_executable(project1 main.cpp template_1.h)

這樣之後你再reloa一下就可以了,如果還要新增其他的檔案,則在後面新增即可。


如圖


---------------------
作者:Billy1900
來源:CSDN
原文:https://blog.csdn.net/Billy1900/article/details/80297105
版權宣告:本文為博主原創文章,轉載請附上博文連結!

相關推薦

解決clionthe file does not belong to any project 的問題

通常clion中會莫名其妙的出現這種問題,並且這會導致程式無法正常執行,我看過網上很多方法,但可能都不太適用。今天我想介紹一下一個簡單的方法。 這時開啟你的cmakelists.txt, 一開始會出現這種狀況(假設我建立了一個template_1.h的檔案) cmak

Clion this file does not belong to any project target問題解決方案

強迫症患者看了這種大大的橫幅提示實在受不了,還讓不讓人好好寫程式碼了。兩種解決方案 第一種: 右鍵工程資料夾建立新檔案時,New右側有個下拉選單,不要選擇File或者Scratched File 第二種: 如果選了不想改,那就在CMakeLists.txt中加進去 比如,我

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提示上圖所示的 解決方

The patch E:\android-sdk-windows does not belong to a directory.Android studio will use this Andriod

問題: 每次匯入新專案的時候都會出現這個提示。 我在安裝Android Studio 選擇的是已經下載好的SDK,並且是放在”E:/android-sdk-windows”這個資料夾下。(你也知道國內keng爹的網速,要是網不快的話不知道下載到什麼時候。

Sync android SDKs path does not belong to a directory

這個問題其實可以忽略的,這個只是 Android studio 的提示資訊而已的。 即匯入的專案 的 SDK路徑和 studio預設使用的不同。 就會使用 studio 的SDK路徑。 不用理會即可。 匯入成功之後 studio 會修改 local.properties 

ValueError: Node ({location: 'shanghai', name: 'mike'}) does not belong to this graph

>>> [i for i in g.relationships.match((g.nodes.match('boy',name='mike'),) )] Traceback (most recent call last): File "<stdin>", l

AWS S3物件無法下載——This XML file does not appear to have any style information associated with it

最近,需要從AWS S3上下載渲染後的圖片,遇到了如下問題: This XML file does not appear to have any style information associat

IntelliJ在類檔案直接修改包名(未定義的包名) 提示Package name does not correspond to the file path

問題就是標題中說的那樣 產生的原因就是:在某個包下建立了一個類發現包名不合適,直接在類檔案頭部第一行修改包名想實現跟eclipse一樣通過快捷鍵 快速生成未定義的包並將該類移動到新建的包下,網上的答案出處基本都是來自stackoverflow的提問 該問題stackoverflow地址:

解決 MySQL 5.7 Your password does not satisfy the current policy requirements. 問題

Mac OS X 下通過 Brew 安裝 MySQL 後,預設密碼為空,然後執行 mysql_secure_installation 命令設定密碼 然後我手賤的在密碼強度那裡輸入了 2(真2了。。。)在這種強度下想要把密碼設定為 123456 就不可能了 再然後我嘗試重

Java問題解決:Java compiler level does not match the version of the installed Java project facet.

問題 compiler .cn 技術分享 cnblogs java編譯 mpi 選中 per 問題原因:Java編譯器級別與Facted Project 中的Java 版本設定不匹配。 解決辦法:將兩者設置一致 1.查看Java compiler level :   選中項

exec: "/bin/xtensa-lx106-elf-g++": file does not exist Arduino for 8266 core 開發錯誤解決辦法

修改 exe gcc elf 升級 pat file lib 2.3 可能的原因及解決辦法:因為xtensa-lx106-elf-gcc這個工具沒有完整安裝,刪除當前版本的8266 開發板,然後重新安裝一次即可 問題現象:最近折騰esp8266和arduino的幾塊板子,

android studio run 的時候,報the apk file does not exist on disk,

bsp mage gpo 重啟 build log nbsp oid alt 1.首先 clean rebuild,重啟,不能解決的話,再找到這個 然後是這裏: 不用填,點ok,ok即可,他喵的,卡我倆小時 android studio run 的時候,報the a

No lease on /目錄: File does not exist. [Lease. Holder: DFSClient_NONMAPREDUCE_-2059237550_1, pendingcreates: 8]錯誤及解決方法

框架 apache val files leg sid format 遇到 mil   感覺程序員的世界真是一個變幻無常且精彩絕倫的世界,每次跑程序都會發現不一樣的問題。今天跑MapReduce程序來統計郵箱次數時遇到了一個問題,明明一樣的代碼,別人能跑,我卻跑不了。我相信

quartus II編譯報錯:Error: Current license file does not support the XXX device

環境:    win7 (64位); quartus II 版本:quartus II 11.0    (64位,32位); 使用quartus II測試"Hello World!"的程式,Qsys製作相應的軟核。 剛開始測試的時候使用quartu

Perhaps JAVA_HOME does not point to the JDK的解決方法

Unable to find a javac compiler;Perhaps JAVA_HOME does not point to the JDK   web專案部署到tomcat7、jdk7的環境下訪問報錯500: Unable to fin

成功解決(wait)KeyError: "The name 'image_tensor:0' refers to a Tensor which does not exist. The operatio

解決問題 KeyError: "The name 'image_tensor:0' refers to a Tensor which does not exist. The operation, 'image_tensor', does not exist in the g

ionicNode Sass does not yet support your current environment解決辦法Node sass安裝

1. npm uninstall --save node-sass   npm install --save node-sass   如果還是不行就執行:npm cache clean 再執行2

Maven出現User setting file does not exist ...\.m2\setting.xml的問題解決(同時也解決使用者.m2目錄下無setting.xml檔案)

如果Eclipse中出現User setting file does not exist ...\.m2\setting.xml這樣的問題,解決方法如下: 1、拷貝%M2_HOME%/conf/settings.xml的檔案到%USER_HOME%/.m2/settings.xml中即可。 經過研究,同時

JAVA_HOME does not point to the JDK 解決方法

Error  Description: Unable to find a javac compiler;com.sun.tools.javac.Main is not on the classpath.Perhaps JAVA_HOME does not point to t

關於在CI引用路徑的問題 File does not exist

我們在開發的過程中,可能設定好base_url之後,再呼叫別的controller的時候,會用src="/header"  之類的呼叫,這種方法,在windows平臺 沒有問題,但是在linux上就不行了,就會出現  File does not exist: /usr/loc