[問題] 用vc++2008寫openGL
不好意思
因為不管怎麼試就是無法compile成功
我已經爬文找過了
沒有看到08版的設定怎麼做 NEHE上面也沒找到
Step 1. 抓Library
到 http://www.xmission.com/~nate/glut.html 下載 glut-x.x.x-bin.zip。
Step 2. 安裝元件
解壓縮後,
把 glut.dll 放到 C:\WINDOWS\system 下
把 glut.h 放到 C:\Program Files\Microsoft Visual Studio\VC98\Include\gl
下
把 glut.lib 放到 C:\Program Files\Microsoft Visual Studio\VC98\Lib 下
Step 3. 編譯設定
到VC的 Project->Setting->"Link" 的 Object/library modules的欄位,
增加glut32.lib glu32.lib opengl32.lib glaux.lib 。
之後再編譯就可以了。
以上這應該是6.0的作法
其中step2的三個檔案我也都找到相應的位置放好了
step3則是在程式碼加入
#include <GL/glut.h>
#include <stdlib.h>
#include <stdafx.h>
#pragma comment (lib, "winmm.lib") /* link with Windows MultiMedia lib */
#pragma comment (lib, "opengl32.lib") /* link with Microsoft OpenGL lib */
#pragma comment (lib, "glu32.lib") /* link with OpenGL Utility lib */
#pragma comment (lib, "glut32.lib") /* link with Win32 GLUT lib */
#pragma comment (lib, "glaux.lib")
可是這樣還是無法成功
1>c:\documents and settings\fox\my documents\visual studio 2008\projects\c++
\robottest\robottest\robottest.cpp(8) : warning C4627:
'#include <GL/glut.h>': skipped when looking for precompiled header use
1> Add directive to 'stdafx.h' or rebuild precompiled header
1>c:\documents and settings\fox\my documents\visual studio 2008\projects\c++
\robottest\robottest\robottest.cpp(29) : error C3861: 'glClearColor':
identifier not found
請告訴我到底要怎麼做才能成功的compile出來
麻煩了
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.112.252.38
→
04/11 21:59, , 1F
04/11 21:59, 1F
→
04/11 22:01, , 2F
04/11 22:01, 2F
→
04/11 22:03, , 3F
04/11 22:03, 3F
→
04/11 22:04, , 4F
04/11 22:04, 4F
→
04/11 22:10, , 5F
04/11 22:10, 5F
推
04/11 23:48, , 6F
04/11 23:48, 6F
推
04/12 00:13, , 7F
04/12 00:13, 7F
→
04/12 00:14, , 8F
04/12 00:14, 8F
→
04/12 00:45, , 9F
04/12 00:45, 9F