天天看點

fatal error C1083: Cannot open include file: 'gl\glext.h': No such file or directory

 調試一些OpenGl程式時,會提示fatal error C1083: Cannot open include file: 'gl\glext.h': No such file or directory錯誤;

我從網上下載下傳了一個glext.h檔案,并将它儲存在..\Microsoft Visual Studio\VC98\Include\GL檔案夾下,重新編譯了一遍;

我以為這下應該沒有問題了,可是依然提示上述錯誤;最終用下列方式解決之:

1.将glext.h檔案拷貝到目前項目的目錄下:

2.将提示有錯誤的那一行#include "gl\glext.h",改為:#include "glext.h";

3.删除debug檔案夾下所有的檔案;(也可以不删除,直接點選‘重新生成解決方案’)

4.重新編輯即可;

問題的原因:一般來說,出現fatal error C1083: Cannot open include file: 'gl\glext.h': No such file or directory錯誤,很明顯是

頭檔案找不到;一般來說,将頭檔案放到VC98下的include檔案夾内,就能解決問題;我電腦裡安裝了VC++6.0,也安裝了VS2005;

是以,可能是VS2005包含的檔案和VC++6.0包含檔案的路徑不一樣;