久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

Eclipse C++ 包括來自我的源文件夾的頭文件

Eclipse C++ including header file from my source folder(Eclipse C++ 包括來自我的源文件夾的頭文件)
本文介紹了Eclipse C++ 包括來自我的源文件夾的頭文件的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

限時送ChatGPT賬號..

總的來說,我對 C++ 和 Eclipse 還很陌生,所以如果我遺漏了一些相當明顯的東西,我深表歉意.

I'm pretty new to C++ and Eclipse in general so I apologise if I'm missing something fairly obvious.

我遇到的問題是我試圖在我的一個源文件中包含一個頭文件,但它們位于我的項目目錄中的不同文件夾中.我不知道我應該如何包括他們.我上傳了一張圖片,顯示了我要突出顯示的頭文件的問題.

The problem I'm having is that I'm trying to include a header file in one of my source files but they're in different folders in my project directory. I have no idea how I should be including them. I've uploaded an image showing my problem with the header file I want to include highlighted.

如果有人能告訴我應該使用什么#include"語句,那就太好了.

If someone could tell me what '#include' statement I should be using them that would be brilliant.

謝謝!

推薦答案

有幾個不同的選項可以完成這項工作.最簡單的是將 #include 改為

There are a couple of different options to make this work. Simplest is to change the #include to

#include "../Statistics/Statistics.h"

這將在沒有任何其他修改的情況下工作.但是,如果您移動任一文件,或以某種方式更改兩者之間的相對路徑,這將中斷.

This will work without any other modifications. However, if you move either file, or somehow change the relative path between the two, this will break.

或者,您可以將 Statistics 文件夾的路徑添加到編譯器的包含文件搜索路徑中.右鍵單擊項目名稱,選擇 Properties -> C/C++ Build -> Settings,然后找到編譯器的包含文件路徑選項.對于 g++,它是 -I.添加這將使 #include 語句像您當前擁有的那樣工作.

Alternately, you can add the path to the Statistics folder to your compiler's include file search path. Right click on the project name, select Properties -> C/C++ Build -> Settings and then find the includes files path option for your compiler. For g++, it is -I<path/to/include/folder>. Adding this will make the #include statement work as you currently have it.

與第二個非常相似的選項是將 src 文件夾的路徑(而不是 Statistics 文件夾)添加到包含搜索路徑.在這種情況下,您必須將語句更改為

A very similar option to the second one is to add the path to the src folder (instead of the Statistics folder) to the includes search path. In this case, you'll have to change the statement to

#include "Statistics/Statistics.h"

這篇關于Eclipse C++ 包括來自我的源文件夾的頭文件的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

How can I make a horizontal sliding calendar in android eclipse?(如何在 android eclipse 中制作水平滑動日歷?)
Open WebSocket connection with authentication cookie(使用身份驗證 cookie 打開 WebSocket 連接)
jax-ws change Content-type to Content-Type because server is hyper sensitive(jax-ws 將 Content-type 更改為 Content-Type 因為服務器是超敏感的)
Eclipse CDT not building project on header file change(Eclipse CDT 沒有在頭文件更改時構建項目)
Multiple editable rows in JTable header(JTable 標題中的多個可編輯行)
How to dynamically set header value in JSP(如何在 JSP 中動態設置標頭值)
主站蜘蛛池模板: 亚洲福利在线观看 | 国产美女自拍 | 9l视频自拍九色9l视频成人 | 伊人久久在线 | 欧美福利一区二区 | 日韩精品一区二区视频 | 成人毛片网 | 五月婷婷在线播放 | 日本欧美久久久久免费播放网 | 日韩欧美大片 | 影音先锋在线观看视频 | 亚洲欧美精品一区二区 | 天天干天天操天天干 | 国产精品一区二区免费 | 亚洲激情文学 | 中文字幕免费在线看线人动作大片 | 日韩一区二区在线播放 | 一级特黄色片 | 亚洲欧美日韩精品 | 国产成人小视频 | 国产伊人网 | 精品免费国产 | 特黄一级毛片 | 91免费观看视频 | 精品在线一区二区 | 国产欧美一区二区精品忘忧草 | 亚洲成人a v | 色婷婷狠狠 | 日本免费不卡视频 | 日韩在线一区二区三区 | 国产在线毛片 | 午夜免费小视频 | 国产又黄又猛 | 欧美在线视频一区 | 国产精品网站在线观看 | 国产精品一品二品 | 成人在线视频观看 | 日韩免费看片 | 一区二区三区国产视频 | 日韩免费一区 | 久久精品久久久 |