2013-08-22 38 views
0

雖然我有一類我在執行類似的頭文件:C++頭包含

#include<Utility.h> 

我仍然得到致命錯誤:Utility.h:沒有這樣的文件或目錄

有什麼想法爲什麼? Utility.h和Utility.cpp在我當前的項目文件夾中

+0

是否在您的系統頭目錄中的頭? – chris

+4

這是您寫的標題嗎?試試'「Utility.h」' – jrok

+0

其實爲什麼不接受<>情況而不是「」情況。 –

回答

0
#include "Utility.h" 

這是包含您編寫並存在於您的項目中的.h文件的方式。

0
#include <file> 
This variant is used for system header files. It searches for a file named file in a standard list of system directories. 

#include "file" 
This variant is used for header files of your own program. It searches for a file named file first in the directory containing the current file, then in the quote directories and then the same directories used for <file>.