How do I compile using cl.exe c++
I know how to compile a simple hello world, but as soon as I try compiling something more complex, for example I've been trying to compile code that links the dependencies to use opengl, glad, and glfw. every time I try this, no matter what I try I cannot figure out how to get this to compile.
I'd share error's but I get so many different errors every time that I'm hoping someone can just tell me what parameters I'm missing.
I set all my dependencies in the same directory as everything else along with the cpp file.
I call vcvarsall.bat x64 in my directory
I'm making sure to use #include "example.h" instead of #include <example.h>
I've tried setting /LIBPATH:"path to glad" etc
nothing is working. I've read a few things about mixing x64 and x32 but I don't think this is the problem.
As soon as I can make sure these dependencies are linking and compiling properly I shouldn't have problems from there.
Someone is probably going to ask so, the reason I am trying to compile and link using cl.exe is because I'd rather not have to make a visual studio project and link all the settings and remember all the project settings to set each time while learning opengl. I feel like if I can get cl.exe to work I can just copy over the dependencies, a build file, and a hello world cpp file and start a new project from there within a few seconds.
any help would be awesome. thanks.
UPDATE:
I was messing around with it again this morning because I knew there had to be a way to get cl to link glfw, and glad, and then whatever I needed from there. to clear things up the code I've been trying to compile is the source code after the lesson here https://learnopengl.com/Getting-started/Hello-Window
they link it at that page at the bottom of the lesson but just for ease here is the source code from learnopengl.com
I was having tons of errors linking gladGLLoader or whatever the name was until this morning I tried 2 things specifically that I think is what fixed my problems.
instead of trying to link any header files I linked glad.c as well as made sure the header files were in the directory.
Also when linking GLFW I was linking the wrong file. in my download of GLFW I have an include folder, a lib-mingw-w64 folder, a lob-sattic-ucrt folder and then a bunch of lib-vcVERSION folders.
Instead of linking out of the lib-vc2022 or 2019 or include folder I tried linking the glfw3.dll.lib out of the lib-static-ucrt folder and made sure that the glfw3.dll file that was in that folder was included in my code directory. this all fixed my problems and now I have opengl compiling with only the compiler that installs beside visual studio and I can copy this code to make a new OpenGL project on the fly.
thanks to everyone for the suggestions and if anyone is wanting help duplicating this setup I would love to help if needed.