opengl window glfw

opengl - GLFW-Error al abrir una ventana



window (1)

A medida que mi búsqueda de un framework / biblioteca multiplataforma avanzaba, GLFW fue mencionado muchas veces. Entonces, decidí probarlo. Ahora, parece que ni siquiera puedo abrir una ventana. : - /

#include #include #include int main(int argc, char *argv[]) { int running = GL_TRUE; srand(time(NULL)); if (!glfwInit()) exit(EXIT_FAILURE); if (!glfwOpenWindow(300, 300, 0, 0, 0, 0, 0, 0, GLFW_WINDOW)) { glfwTerminate(); exit(EXIT_FAILURE); } while (running) { 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(EXIT_SUCCESS); }

Escribí esto en MVC ++ 2010, vinculé el encabezado y 2 archivos lib (y tenía 1 archivo DLL, así que lo metí en la carpeta SysWOW64), y obtengo estos errores:

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 ==========

Entiendo a los primeros pocos con los colores aleatorios, pero después de eso no tienen sentido para mí. ¿Alguna idea de lo que está mal con esto?

Estoy bastante seguro de que he vinculado las libretas correctamente. Los coloco en el directorio C: / Archivos de programa (x86) / Microsoft Visual Studio 10.0 / VC / lib e incluso los vinculé a mi directorio C: / SDK / GLFW / glfw-2.7.bin.WIN32 / lib-msvc100 / debug .

El paquete GLFW era un archivo .zip, así que lo extraje a mi carpeta SDK predeterminada (para todas mis API y otras cosas). Así que el C: / SDK / GLFW es mi valor predeterminado para GLFW.


Es necesario vincular a opengl32.lib.

Me gusta:

excepto con opengl32.lib.

edición: debo tener en cuenta que no es necesario hacer nada, excepto agregar opengl32.lib. Esa otra cosa es irrelevante. Además, si ambos están presentes, intente intercambiar el pedido, lo que importa en algunos casos.