At the moment, I am trying to make a project using GLFW, but I am getting a LNK2019 error for all glfw function. Most tutorials I seen involves using visual studio or CMake to setup the project, but finding a tutorial using the command line is hard to come by. On the bottom of the GLFW
site about manual compilation, I do not really understand how it want me to setup the build (I still relatively new to building from command line). I am using Casey's build has the baseline for my GLFW build. I tried using /LIBPATH to tell the linker where it can find the glfw3.lib library, but still have errors. I also tried to mimic how visual studio setup GLFW, but came up with nothing. I also thought that the LNK 4272 warning was the issue and tried putting /machine:x86 on the linker, but that gave me an another problem.
Is it possible to link to glfw3.lib from command line? If so, how?
Workstation machine: Surface Pro 4 x64
Compiler: cl.exe x64
GLFW Download: 32-bit Windows binaries
My build file:
| pushd ..\..\build
cl -nologo -IW:\glplay\glplay\Dependencies\GLFW\include ..\glplay\code\main.cpp /link /LIBPATH:W:\glplay\glplay\Dependencies\GLFW\lib-vc2015 glfw3.lib opengl32.lib user32.lib gdi32.lib
popd
|
Error code:
| main.obj : error LNK2019: unresolved external symbol glfwInit referenced in function main
main.obj : error LNK2019: unresolved external symbol glfwTerminate referenced in function main
main.obj : error LNK2019: unresolved external symbol glfwCreateWindow referenced in function main
main.obj : error LNK2019: unresolved external symbol glfwWindowShouldClose referenced in function main
main.obj : error LNK2019: unresolved external symbol glfwPollEvents referenced in function main
main.obj : error LNK2019: unresolved external symbol glfwMakeContextCurrent referenced in function main
main.obj : error LNK2019: unresolved external symbol glfwSwapBuffers referenced in function main
glfw3.lib : warning LNK4272: library machine type 'x86' conflicts with target machine type 'x64'
|