Windows 7上的MSVS C ++ express 2010上的opengl编程

时间:2010-08-07 11:34:21

标签: opengl glut

我已经尝试了所有可以找到的网络上的解决方案..但是在使用MSVS C ++ 2010快速版编译Windows 7的简单教程时仍然没有成功。

如果有人能给我提供如何处理的线索,我会感激不尽。

感谢。

编辑:错误

------ Build started: Project: Polyons, Configuration: Debug Win32 ------
C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(990,5): warning MSB8012: TargetPath(C:\Users\Ashish\Downloads\GameloftOpenGL\02Polygons\.\Debug\Polyons.exe) does not match the Linker's OutputFile property value (C:\Users\Ashish\Downloads\GameloftOpenGL\02Polygons\Debug\test.exe). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).
C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(992,5): warning MSB8012: TargetName(Polyons) does not match the Linker's OutputFile property value (test). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).
Polygons.obj : error LNK2019: unresolved external symbol _gluPerspective referenced in function "void __cdecl ReSizeGLScene(int,int)" (?ReSizeGLScene@@YAXHH@Z)
Polygons.obj : error LNK2019: unresolved external symbol _glLoadIdentity referenced in function "void __cdecl ReSizeGLScene(int,int)" (?ReSizeGLScene@@YAXHH@Z)
Polygons.obj : error LNK2019: unresolved external symbol _glMatrixMode referenced in function "void __cdecl ReSizeGLScene(int,int)" (?ReSizeGLScene@@YAXHH@Z)
Polygons.obj : error LNK2019: unresolved external symbol _glViewport referenced in function "void __cdecl ReSizeGLScene(int,int)" (?ReSizeGLScene@@YAXHH@Z)
Polygons.obj : error LNK2019: unresolved external symbol _glHint referenced in function "int __cdecl InitGL(void)" (?InitGL@@YAHXZ)
Polygons.obj : error LNK2019: unresolved external symbol _glDepthFunc referenced in function "int __cdecl InitGL(void)" (?InitGL@@YAHXZ)
Polygons.obj : error LNK2019: unresolved external symbol _glEnable referenced in function "int __cdecl InitGL(void)" (?InitGL@@YAHXZ)
Polygons.obj : error LNK2019: unresolved external symbol _glClearDepth referenced in function "int __cdecl InitGL(void)" (?InitGL@@YAHXZ)
Polygons.obj : error LNK2019: unresolved external symbol _glClearColor referenced in function "int __cdecl InitGL(void)" (?InitGL@@YAHXZ)
Polygons.obj : error LNK2019: unresolved external symbol _glShadeModel referenced in function "int __cdecl InitGL(void)" (?InitGL@@YAHXZ)
Polygons.obj : error LNK2019: unresolved external symbol _glEnd referenced in function "void __cdecl DrawCube(float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float)" (?DrawCube@@YAXMMMMMMMMMMMMMMMMMMMMMMMM@Z)
Polygons.obj : error LNK2019: unresolved external symbol _glVertex3f referenced in function "void __cdecl DrawCube(float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float)" (?DrawCube@@YAXMMMMMMMMMMMMMMMMMMMMMMMM@Z)
Polygons.obj : error LNK2019: unresolved external symbol _glColor3f referenced in function "void __cdecl DrawCube(float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float)" (?DrawCube@@YAXMMMMMMMMMMMMMMMMMMMMMMMM@Z)
Polygons.obj : error LNK2019: unresolved external symbol _glBegin referenced in function "void __cdecl DrawCube(float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float,float)" (?DrawCube@@YAXMMMMMMMMMMMMMMMMMMMMMMMM@Z)
Polygons.obj : error LNK2019: unresolved external symbol _glClear referenced in function "int __cdecl DrawGLScene(void)" (?DrawGLScene@@YAHXZ)
.\Debug/test.exe : fatal error LNK1120: 15 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

1 个答案:

答案 0 :(得分:1)

您必须链接正确的库

转到Project-> Settings-> Linker-> input->其他库,并添加:

opengl32.lib glu32.lib