Handmade Hero»Forums»Code
David
2 posts
Help- 'cl' is not a recognized command
I'm into video 11, and have been both coding and building the program with Visual Studios which is easily the worst IDE I've ever worked with. I originally started my development using only VS, and I've somehow borked my project, so I'm starting over.

God, I hate Microsoft. But thats an aside.

So I have downloaded Casey's code, and am trying to do as he does in stream, writing in (in my case in Sublime text) and running it from the command line. Unfortunately, cl doesn't seem to be set up on my machine. So when I open click the build.bat file, it does nothing.

So i have a few questions:

First, how can I set up this environment variable so I can run cl in the command line to run it?

Secondly, once I have the variable set up, how can I follow Casey's workflow? I.E. how do I build and run the project either via the command line or clicking on build.bat, and then open it for debugging in VS?

Basically I want to restart my development on video 11, and want to get it set up like his environment(sans the emacs)

Any help is greatly appreciated.
55 posts
Help- 'cl' is not a recognized command
Edited by elle on
You need to search for the "vcvarsall.bat" file and run that in the command prompt to setup the "cl" command. This adds "cl" to the path.

For example, the following commands should configure command-line builds:

1
2
cd "\Program Files (x86)\Microsoft Visual Studio 12.0\VC"
vcvarsall amd64


I think there's a text file in the HH misc directory with the command-line arguments that you can use to have every command prompt configure this when you open it.
Dustin Specht
12 posts
Help- 'cl' is not a recognized command
Microsoft thought it would be ok to make you run a batch file everything you close and open your command prompt to use devtools, so you can either run the dev console or run the setup. If you actually go watch the start of the series were he sets up the cmd icon on the desktop he shows how to get it working. but all you need to do is create the shortcut and target [cmd /k W:\misc\shell.bat] or from the console run the w:\misc\shell.bat all it does is run [call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x64] which sets up the 64bit compiler.

if you want to watch Casey show it its https://forums.handmadehero.org/j...videos/win32-platform/day001.html 23:41 minutes into the video.