Errors in c++ and OpenGL window code

Hello I am using a code from Tutorial 1 : Opening a window and when I build this code I get 15 errors and have no idea on how to fix this… Any ideas?

Errors:

dummy.obj : error LNK2005: main already defined in main.obj [C:\Users\flami\source\repos\Windows2.0\Windows2.0\Windows2
.0.vcxproj]
main.obj : error LNK2019: unresolved external symbol __imp_glClear referenced in function main [C:\Users\flami\source\r
epos\Windows2.0\Windows2.0\Windows2.0.vcxproj]
main.obj : error LNK2019: unresolved external symbol __imp_glClearColor referenced in function main [C:\Users\flami\sou
rce\repos\Windows2.0\Windows2.0\Windows2.0.vcxproj]
main.obj : error LNK2019: unresolved external symbol __imp_glewInit referenced in function main [C:\Users\flami\source
repos\Windows2.0\Windows2.0\Windows2.0.vcxproj]
main.obj : error LNK2019: unresolved external symbol __imp_glfwInit referenced in function main [C:\Users\flami\source
repos\Windows2.0\Windows2.0\Windows2.0.vcxproj]
main.obj : error LNK2019: unresolved external symbol __imp_glfwTerminate referenced in function main [C:\Users\flami\so
urce\repos\Windows2.0\Windows2.0\Windows2.0.vcxproj]
main.obj : error LNK2019: unresolved external symbol __imp_glfwWindowHint referenced in function main [C:\Users\flami\s
ource\repos\Windows2.0\Windows2.0\Windows2.0.vcxproj]
main.obj : error LNK2019: unresolved external symbol __imp_glfwCreateWindow referenced in function main [C:\Users\flami
\source\repos\Windows2.0\Windows2.0\Windows2.0.vcxproj]
main.obj : error LNK2019: unresolved external symbol __imp_glfwWindowShouldClose referenced in function main [C:\Users
flami\source\repos\Windows2.0\Windows2.0\Windows2.0.vcxproj]
main.obj : error LNK2019: unresolved external symbol __imp_glfwPollEvents referenced in function main [C:\Users\flami\s ource\repos\Windows2.0\Windows2.0\Windows2.0.vcxproj]
main.obj : error LNK2019: unresolved external symbol __imp_glfwSetInputMode referenced in function main [C:\Users\flami
\source\repos\Windows2.0\Windows2.0\Windows2.0.vcxproj]
main.obj : error LNK2019: unresolved external symbol __imp_glfwGetKey referenced in function main [C:\Users\flami\sourc
e\repos\Windows2.0\Windows2.0\Windows2.0.vcxproj]
main.obj : error LNK2019: unresolved external symbol __imp_glfwMakeContextCurrent referenced in function main [C:\Users
\flami\source\repos\Windows2.0\Windows2.0\Windows2.0.vcxproj]
main.obj : error LNK2019: unresolved external symbol __imp_glfwSwapBuffers referenced in function main [C:\Users\flami
source\repos\Windows2.0\Windows2.0\Windows2.0.vcxproj]
C:\Users\flami\source\repos\Windows2.0\x64\Debug\Windows2.0.exe : fatal error LNK1120: 13 unresolved externals [C:\User
s\flami\source\repos\Windows2.0\Windows2.0\Windows2.0.vcxproj]

Here’s a possible tip:

[ul]
[li]Errors when compiling - D Programming Language[/li][/ul]
Check out the libs you’re linking with and make sure they’re all the same architecture, and make sure you’re linking to libs for GLFW, GLEW, and OpenGL.

So I tried the path of the lib and the lib itself (glew.lib and glfw3.lib because those are the only ones that I have) and with the path it gives me the same errors and without the path it just says could not find glew.lib/glfw3.lib…

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.