2013-05-29 70 views
-1

我得到了3D hanoy遊戲代碼(using opengl ,glut)。當我嘗試,我想這些問題都失蹤功能來運行這個遊戲使用VS 12,下列 都出現錯誤---opengl函數未定義

glutTimerFunc is undefined 

glutInit is undefined 


glutWindowSize is undefined 

glPushMatrix is undefined 

glRotatef is undefined 

glTranslatef is undefined 

glutSolidTorus is undefined 

glPopMatirx is undefined 

,如何才能在我的代碼添加這些功能來運行呢?

+0

你有沒有把你的glut庫加入到你的項目中? – ncite

+0

我想是這樣......我再次運行它,現在它顯示「無法打開文件:gl/glut.h」 – tun

+0

它應該是庫路徑和頭文件路徑問題。你可以在Visual Studio教程中找到GLUT,看看你做錯了什麼,就像這樣:http://ins.nafsadh.com/2009/09/07/opengl-and-glut-in-c-with-ms-視覺工作室2008年msvs9 / – ncite

回答

0

關注thisthis教程,向您介紹使用GLUT構建應用程序的基礎知識。

希望它有幫助