作者bill42362 (酒池肉林夜夜生科)
看板C_and_CPP
標題[心得] glut7.6.3 in code block 10.5 with MinGW in windows
時間Tue Jun 1 23:32:31 2010
分享一下試了超久的心得...
A. 首先依照這個網頁
http://www.sci.brooklyn.cuny.edu/~goetz/codeblocks/glut/
備分在此:
Download the GLUT bin file (first download link) from:
http://www.xmission.com/~nate/glut.html
After you download and open the GLUT bin zip file, you will need to:
1. Copy glut32.dll to c:\windows\system,
2. Copy glut32.lib to c:\program files\mingw\lib, and
3. Copy glut.h to c:\program files\mingw\include\GL.
4. These are default locations, your paths may be different.
But basically, you place the .lib and .h files in the location
of your compiler (in this case mingw).
The .dll file goes in the windows system directory.
B. 然後建立內建的 glut 專案
C. 在你開始編譯之前 依照這個網站作修正:
http://forums.codeblocks.org/index.php/topic,1000.msg79030.html#msg79030
備份在此:
1. in
glut.h
on line
10 change (好像不是準 10 行 前後找一下...)
Code:
# if 0
to
Code:
# if (_WIN_ALL)
Then go in the
Project ->
Build Options... ->
#defines and add :
_WIN_ALL
This should correct the error: redeclaration of C++ built-in type `short'
2. on line
100 add
Code:
#define GLUT_DISABLE_ATEXIT_HACK
This should correct the warning:
'int glutCreateMenu_ATEXIT_HACK(void(*)(int))' defined but not used
D. 編譯專案
看到六個在旋轉的可愛幾何圖案就是成功了!!!
--
想你的時候 不一定能告訴你
如果不告訴你 也能會意
那我們就是有 真正的默契
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 61.57.96.119
推 VictorTom:感謝您的分享, 以前不知道要改glut.h, 還為了exit衝突改 06/01 23:37
→ VictorTom:source裡和stdlib.h的#include順序....Orz 06/01 23:38