GLFW-无法打开窗口

| 在我寻求跨平台框架/库的过程中,GLFW被多次提及。因此,我决定尝试一下。现在,似乎我什至无法启动窗口。 :-/ #包括 #包括 #包括 int main(int argc,char * argv []) {     int running = GL_TRUE;     srand(time(NULL));     如果(!glfwInit())         退出(EXIT_FAILURE);     如果(!glfwOpenWindow(300,300,0,0,0,0,0,0,GLFW_WINDOW))     {         glfwTerminate();         退出(EXIT_FAILURE);     }     在跑步的时候)     {         glClear(GL_COLOR_BUFFER_BIT);         glClearColor(rand()%255 + 1,rand()%255 + 1,rand()%255 + 1,0);         glfwSwapBuffers();         running =!glfwGetKey(GLFW_KEY_ESC)&& glfwGetWindowParam(GLFW_OPENED);     }     glfwTerminate();     退出(EXIT_SUCCESS); } 我在MVC ++ 2010中键入了此内容,链接了标头和2个lib文件(并且它有1个DLL文件,因此我将其扔到SysWOW64文件夹中),然后出现以下错误:
1>------ Build started: Project: glfwTest, Configuration: Debug Win32 ------
1> test.cpp
1>c:\\users\\andrew\\documents\\visual studio 2010\\projects\\glfwtest\\glfwtest\\test.cpp(8): warning C4244: \'argument\' : conversion from \'time_t\' to \'unsigned int\', possible loss of data
1>c:\\users\\andrew\\documents\\visual studio 2010\\projects\\glfwtest\\glfwtest\\test.cpp(22): warning C4244: \'argument\' : conversion from \'int\' to \'GLclampf\', possible loss of data
1>c:\\users\\andrew\\documents\\visual studio 2010\\projects\\glfwtest\\glfwtest\\test.cpp(22): warning C4244: \'argument\' : conversion from \'int\' to \'GLclampf\', possible loss of data
1>c:\\users\\andrew\\documents\\visual studio 2010\\projects\\glfwtest\\glfwtest\\test.cpp(22): warning C4244: \'argument\' : conversion from \'int\' to \'GLclampf\', possible loss of data
1>test.obj : error LNK2019: unresolved external symbol __imp__glClearColor@16 referenced in function _main
1>GLFW.lib(win32_window.obj) : error LNK2001: unresolved external symbol __imp__glClearColor@16
1>test.obj : error LNK2019: unresolved external symbol __imp__glClear@4 referenced in function _main
1>GLFW.lib(window.obj) : error LNK2001: unresolved external symbol __imp__glClear@4
1>GLFW.lib(win32_window.obj) : error LNK2001: unresolved external symbol __imp__glClear@4
1>GLFW.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp__wglGetProcAddress@4 referenced in function _initWGLExtensions
1>GLFW.lib(win32_glext.obj) : error LNK2001: unresolved external symbol __imp__wglGetProcAddress@4
1>GLFW.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp__wglMakeCurrent@8 referenced in function _createWindow
1>GLFW.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp__wglCreateContext@4 referenced in function _createContext
1>GLFW.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp__wglDeleteContext@4 referenced in function _destroyWindow
1>GLFW.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp__glGetFloatv@8 referenced in function __glfwPlatformSetWindowSize
1>GLFW.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp__glGetIntegerv@8 referenced in function __glfwPlatformSetWindowSize
1>GLFW.lib(glext.obj) : error LNK2001: unresolved external symbol __imp__glGetIntegerv@8
1>GLFW.lib(glext.obj) : error LNK2019: unresolved external symbol __imp__glGetString@4 referenced in function __glfwParseGLVersion
1>c:\\users\\andrew\\documents\\visual studio 2010\\Projects\\glfwTest\\Debug\\glfwTest.exe : fatal error LNK1120: 9 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
我了解前几种颜色是随机的,但之后的颜色对我来说毫无意义。知道这怎么了吗? 我很确定我已正确链接了库。我将它们放入 C:\\ Program Files(x86)\\ Microsoft Visual Studio 10.0 \\ VC \\ lib目录 甚至将它们链接到我的 C:\\ SDK \\ GLFW \\ glfw-2.7.bin.WIN32 \\ lib-msvc100 \\ debug目录。 GLFW软件包是一个.zip文件,因此我只是将其提取到我的默认SDK文件夹中(用于所有API和其他内容)。因此,C:\\ SDK \\ GLFW是我的GLFW默认设置。     
已邀请:
您需要链接到
opengl32.lib
。 为此,如下图所示,转到
Project Setting
,然后转到
Linker > input > Additional Dependencies
,然后在其中添加
opengl32.lib
(使用
;
分隔不同的库)。 请注意,您实际上不需要在任何地方都具有
opengl32.lib
文件。 Visual Studio知道在哪里可以找到它。 编辑:我应该注意,除了添加ѭ1之外,您不需要执行任何其他操作。其他东西无关紧要。此外,如果两者都存在,请尝试交换订单,这在某些情况下很重要。     

要回复问题请先登录注册