Severity Code Description Project File Line Suppression State
Error LNK1120 22 unresolved externals OpenGL2 C:\Users\Darek\source\repos\OpenGL2\Debug\OpenGL2.exe 1
Error LNK2019 unresolved external symbol __imp__glewInit@0 referenced in function _main OpenGL2 C:\Users\Darek\source\repos\OpenGL2\OpenGL2\OpenGL2.obj 1
Error LNK2001 unresolved external symbol __imp____glewBindBuffer OpenGL2 C:\Users\Darek\source\repos\OpenGL2\OpenGL2\OpenGL2.obj 1
Error LNK2001 unresolved external symbol __imp____glewBufferData OpenGL2 C:\Users\Darek\source\repos\OpenGL2\OpenGL2\OpenGL2.obj 1
Error LNK2001 unresolved external symbol __imp____glewDeleteBuffers OpenGL2 C:\Users\Darek\source\repos\OpenGL2\OpenGL2\OpenGL2.obj 1
Error LNK2001 unresolved external symbol __imp____glewGenBuffers OpenGL2 C:\Users\Darek\source\repos\OpenGL2\OpenGL2\OpenGL2.obj 1
Error LNK2001 unresolved external symbol __imp____glewAttachShader OpenGL2 C:\Users\Darek\source\repos\OpenGL2\OpenGL2\OpenGL2.obj 1
Error LNK2001 unresolved external symbol __imp____glewCompileShader OpenGL2 C:\Users\Darek\source\repos\OpenGL2\OpenGL2\OpenGL2.obj 1
Error LNK2001 unresolved external symbol __imp____glewCreateProgram OpenGL2 C:\Users\Darek\source\repos\OpenGL2\OpenGL2\OpenGL2.obj 1
Error LNK2001 unresolved external symbol __imp____glewCreateShader OpenGL2 C:\Users\Darek\source\repos\OpenGL2\OpenGL2\OpenGL2.obj 1
Error LNK2001 unresolved external symbol __imp____glewDeleteProgram OpenGL2 C:\Users\Darek\source\repos\OpenGL2\OpenGL2\OpenGL2.obj 1
Error LNK2001 unresolved external symbol __imp____glewDeleteShader OpenGL2 C:\Users\Darek\source\repos\OpenGL2\OpenGL2\OpenGL2.obj 1
Error LNK2001 unresolved external symbol __imp____glewEnableVertexAttribArray OpenGL2 C:\Users\Darek\source\repos\OpenGL2\OpenGL2\OpenGL2.obj 1
Error LNK2001 unresolved external symbol __imp____glewGetAttribLocation OpenGL2 C:\Users\Darek\source\repos\OpenGL2\OpenGL2\OpenGL2.obj 1
Error LNK2001 unresolved external symbol __imp____glewLinkProgram OpenGL2 C:\Users\Darek\source\repos\OpenGL2\OpenGL2\OpenGL2.obj 1
Error LNK2001 unresolved external symbol __imp____glewShaderSource OpenGL2 C:\Users\Darek\source\repos\OpenGL2\OpenGL2\OpenGL2.obj 1
Error LNK2001 unresolved external symbol __imp____glewUseProgram OpenGL2 C:\Users\Darek\source\repos\OpenGL2\OpenGL2\OpenGL2.obj 1
Error LNK2001 unresolved external symbol __imp____glewVertexAttribPointer OpenGL2 C:\Users\Darek\source\repos\OpenGL2\OpenGL2\OpenGL2.obj 1
Error LNK2001 unresolved external symbol __imp____glewBindFragDataLocation OpenGL2 C:\Users\Darek\source\repos\OpenGL2\OpenGL2\OpenGL2.obj 1
Error LNK2001 unresolved external symbol __imp____glewBindVertexArray OpenGL2 C:\Users\Darek\source\repos\OpenGL2\OpenGL2\OpenGL2.obj 1
Error LNK2001 unresolved external symbol __imp____glewDeleteVertexArrays OpenGL2 C:\Users\Darek\source\repos\OpenGL2\OpenGL2\OpenGL2.obj 1
Error LNK2001 unresolved external symbol __imp____glewGenVertexArrays OpenGL2 C:\Users\Darek\source\repos\OpenGL2\OpenGL2\OpenGL2.obj 1
Error LNK2001 unresolved external symbol __imp__glewExperimental OpenGL2 C:\Users\Darek\source\repos\OpenGL2\OpenGL2\OpenGL2.obj 1
就像你看到的,我可能有链接库的问题。我尝试了很多不同的方法,但我仍然可以找到它是什么。
我有一个项目要做,从我的学校,与这些库。GLEW, SFML.
我使用Visual Studio 2019。我认为我链接正确的库。
Project ->;Properties ->;Configurations Properties ->;CC++ ->;General ->;Additional Include Directories。
$(SolutionDir)SFML-2.5.1\include
$(SolutionDir)glew-2.1.0\include
项目 -> 属性 -> 配置属性 -> 链接器 -> 常规 -> 附加库目录。
$(SolutionDir)glew-2.1.0\lib\Release\Win32
$(SolutionDir)SFML-2.5.1\lib
Project -> Properties -> Configurations Properties -> Linker -> Input-> Additional Dependencies。
sfml-graphics-d.lib
sfml-window-d.lib
sfml-audio-d.lib
sfml-network-d.lib
sfml-system-d.lib
opengl32.lib
我在调试和发布目录下添加了dll文件,分别是:glew32.dll、sfml-system-d-2.dll、sfml-window-2-d.dll、sfml-system-d.dll、sfml-window-2.dll。glew32.dll, sfml-system-d-2.dll, sfml-window-2-d.dll, sfml-system-d.dll, sfml-window-2.dll。
我想也许我只是放错了x86x64的版本,所以我又试着从这个网站下载文件。
https:/sourceforge.netprojectsglewfilesglew2.1.0glew-2.1.0-win32.zipdownload。
https:/www.sfml-dev.orgfilesSFML-2.5.1-windows-vc15-32-bit.zip
我只用了x86版本,但我还是不知道是什么原因导致了这个错误。
我可以以某种方式调试这个问题,以找到为什么它不工作的共鸣?- 或者说我没有把这个错误的原因归结到自己身上?
所以,因为我的愚蠢,我只是忘了添加 glew32.lib 到。
Project -> Properties -> Configurations Properties -> Linker -> Input-> Additional Dependencies.