新手求助:OpenGL 不能在 Visual Studio .Net 中运行!

shuishoumiaomiao 2009-03-20 02:02:59
我的操作系统是 Windows XP SP3, 在 Visual Studio . Net 2008 上用 VC++ 2008 调用 OpenGL, 设置是按 http://blog.csdn.net/oglmatrix/ 的 "ZEUS 教程2:设置OpenGL编程环境" 来设置,然后用了 NeHe 的 OpenGL 课程的第一课来运行,但不成功,我是按要求从 OpenGL.org 上下载了 glut.3.7.zip , 不能运行,最后在 VC++ 6.0 中把相关的 .h,.lib, .dll 放到相应的文件夹中,结果还是不行,代码在 http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=01 的 Visual Studio .Net 版本,以下是运行后出现的错误, 请指教,多谢!


错误 1 error LNK2019: 无法解析的外部符号 _gluPerspective@32,该符号在函数 "void __cdecl

ReSizeGLScene(int,int)" (?ReSizeGLScene@@YAXHH@Z) 中被引用 main lesson1handwriting2(nonehesdk)
错误 2 error LNK2019: 无法解析的外部符号 __imp__glLoadIdentity@0,该符号在函数 "void __cdecl

ReSizeGLScene(int,int)" (?ReSizeGLScene@@YAXHH@Z) 中被引用 main lesson1handwriting2(nonehesdk)
错误 3 error LNK2019: 无法解析的外部符号 __imp__glMatrixMode@4,该符号在函数 "void __cdecl

ReSizeGLScene(int,int)" (?ReSizeGLScene@@YAXHH@Z) 中被引用 main lesson1handwriting2(nonehesdk)
错误 4 error LNK2019: 无法解析的外部符号 __imp__glViewport@16,该符号在函数 "void __cdecl

ReSizeGLScene(int,int)" (?ReSizeGLScene@@YAXHH@Z) 中被引用 main lesson1handwriting2(nonehesdk)
错误 5 error LNK2019: 无法解析的外部符号 __imp__glHint@8,该符号在函数 "int __cdecl InitGL(void)" (?

InitGL@@YAHXZ) 中被引用 main lesson1handwriting2(nonehesdk)
错误 6 error LNK2019: 无法解析的外部符号 __imp__glDepthFunc@4,该符号在函数 "int __cdecl InitGL

(void)" (?InitGL@@YAHXZ) 中被引用 main lesson1handwriting2(nonehesdk)
错误 7 error LNK2019: 无法解析的外部符号 __imp__glEnable@4,该符号在函数 "int __cdecl InitGL(void)"

(?InitGL@@YAHXZ) 中被引用 main lesson1handwriting2(nonehesdk)
错误 8 error LNK2019: 无法解析的外部符号 __imp__glClearDepth@8,该符号在函数 "int __cdecl InitGL

(void)" (?InitGL@@YAHXZ) 中被引用 main lesson1handwriting2(nonehesdk)
错误 9 error LNK2019: 无法解析的外部符号 __imp__glClearColor@16,该符号在函数 "int __cdecl InitGL

(void)" (?InitGL@@YAHXZ) 中被引用 main lesson1handwriting2(nonehesdk)
错误 10 error LNK2019: 无法解析的外部符号 __imp__glShadeModel@4,该符号在函数 "int __cdecl InitGL

(void)" (?InitGL@@YAHXZ) 中被引用 main lesson1handwriting2(nonehesdk)
错误 11 error LNK2019: 无法解析的外部符号 __imp__glClear@4,该符号在函数 "int __cdecl DrawGLScene

(void)" (?DrawGLScene@@YAHXZ) 中被引用 main lesson1handwriting2(nonehesdk)
错误 12 error LNK2019: 无法解析的外部符号 __imp__wglDeleteContext@4,该符号在函数 "void __cdecl

KillGLWindow(void)" (?KillGLWindow@@YAXXZ) 中被引用 main lesson1handwriting2(nonehesdk)
错误 13 error LNK2019: 无法解析的外部符号 __imp__wglMakeCurrent@8,该符号在函数 "void __cdecl

KillGLWindow(void)" (?KillGLWindow@@YAXXZ) 中被引用 main lesson1handwriting2(nonehesdk)
错误 14 error LNK2019: 无法解析的外部符号 __imp__wglCreateContext@4,该符号在函数 "int __cdecl

CreateGLWindow(char *,int,int,int,bool)" (?CreateGLWindow@@YAHPADHHH_N@Z) 中被引用 main

lesson1handwriting2(nonehesdk)
错误 15 fatal error LNK1120: 14 个无法解析的外部命令 D:\OpenGL Nehe SDK\lesson1handwriting2

(nonehesdk)\Debug\lesson1handwriting2 lesson1handwriting2(nonehesdk)
...全文
264 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
shuishoumiaomiao 2009-03-21
  • 打赏
  • 举报
回复
多谢1楼 eblis88 和 2楼crond,问题已得到解决!Thank you so much!
eblis88 2009-03-20
  • 打赏
  • 举报
回复
#include <gl\gl.h> //opengl32.lib
#include <gl\glu.h> //glu32.lib

#pragma comment(lib, "OPENGL32.LIB")
#pragma comment(lib, "GLU32.LIB")

put it in <stdafx.h>
crond123 2009-03-20
  • 打赏
  • 举报
回复
楼上正解

4,506

社区成员

发帖
与我相关
我的任务
社区描述
图形图像/机器视觉
社区管理员
  • 机器视觉
  • 迪菲赫尔曼
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧