Linker error LNK 2019

Severity	Code	Description	Project	File	Line	Suppression State
Error	LNK2019	unresolved external symbol _glfwOpenWindow referenced in function _init	Project32	C:\Users\Owner\source\repos\Project32\Project32\tutorial_2.obj	1	
Error	LNK2019	unresolved external symbol _glfwOpenWindowHint referenced in function _init	Project32	C:\Users\Owner\source\repos\Project32\Project32\tutorial_2.obj	1	
Error	LNK2019	unresolved external symbol _glfwGetWindowParam referenced in function _main	Project32	C:\Users\Owner\source\repos\Project32\Project32\tutorial_2.obj	1	
Error	LNK2019	unresolved external symbol _glfwEnable referenced in function _init	Project32	C:\Users\Owner\source\repos\Project32\Project32\tutorial_2.obj	1	

I am getting a linker error and don’t know how to resolve it.

if you see an “unresolved external symbol” linker error, it means that you #include’d all the header files you need to use functions of a certain library- glfw in this case- but you didnt tell the linker to use the library itself. in windows it is a file that ends with .lib i think. if you use mingw, you have to add a “-l” linker flag, e.g. “-lm” for the math lib, “-lGL” and “-lGLU” for opengl/glu (or maybe “-lOpenGL32” / “-lGLU32”, not 100% sure about that)

well I linked in all the files I could find that end with .lib

Those symbols you’re missing come from the GLFW library, so make sure you’re linking that in. Also, make sure that if your compiling 32-bit, you’re linking with a 32-bit GLFW library (and vice-versa: 64-bit with 64-bit).

If you are, check these threads for more ideas:

I am doing another program and am getting the following error.

Severity	Code	Description	Project	File	Line	Suppression State
Error	LNK2019	unresolved external symbol __alloca referenced in function _stbi_zlib_decode_noheader_buffer	Project40	C:\Users\Owner\Desktop\Project40\Project40\SOIL.lib(stb_image_aug.o)	1	
Error	LNK2019	unresolved external symbol _sqrtf referenced in function _RGBE_to_RGBdivA2	Project40	C:\Users\Owner\Desktop\Project40\Project40\SOIL.lib(image_helper.o)	1

I am having problems making the soil2.lib file here is my error.

Severity	Code	Description	Project	File	Line	Suppression State
Error	LNK2019	unresolved external symbol _etc1_get_encoded_data_size referenced in function _stbi__pkm_load	Project40	C:\Users\Owner\Desktop\Project40\Project40\SOIL2.obj	1	
Error	LNK2019	unresolved external symbol _etc1_decode_image referenced in function _stbi__pkm_load	Project40	C:\Users\Owner\Desktop\Project40\Project40\SOIL2.obj	1	
Error	LNK2019	unresolved external symbol _sqrtf referenced in function _RGBE_to_RGBdivA2	Project40	C:\Users\Owner\Desktop\Project40\Project40\SOIL.lib(image_helper.o)	1

well after building soil2.lib I linked it into my project and it worked, thanks for all the help.