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

來源:互聯網
上載者:User

 調試一些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包含檔案的路徑不一樣;

 

正如我所料,VC++6.0與VS2005的GL檔案夾是獨立的,第一次修改的是VC++6.0的軟體的;

我的VS2005,gl路徑為:D:\VisualStudio2005\VC\PlatformSDK\Include\gl

因此,將glext.h拷貝其中就可以了;

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.