Handmade Hero»Forums»Code
100 posts
Help with build
Edited by da447m on

Hi, I've tried combinations of a lot of stuff but it doesn't work. I've set in the path these for binaries and includes:

C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.25.28610\include
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.25.28610\bin\Hostx64\x64
C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared

And I assumed all I needed to do was running shell.bat in handmade\misc and then build.bat in handmade\code, but keep getting

'ctime' is not recognized as an internal or external command,
operable program or batch file.
'cl' is not recognized as an internal or external command,
operable program or batch file.
'cl' is not recognized as an internal or external command,
operable program or batch file.
'cl' is not recognized as an internal or external command,
operable program or batch file.
'cl' is not recognized as an internal or external command,
operable program or batch file.
'ctime' is not recognized as an internal or external command,
operable program or batch file.

Casey explained some of those in video 1 of the series, but I'm not sure if files changed or smth. I can go to the cl.exe in visual studio folder and make it work (now MS puts it in a different folder from 2014). How can I build from there? Shouldn't it be automatically found from the env variables in the path I included?

Cheers

Simon Anciaux
1341 posts
Help with build

To compile, you need to call vcvarsall.bat from a console and keep that open and compile from it.

The exact command should be (assuming default install path; don't forget the x64 at the end to setup the compiler for 64bit build): "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" x64

If you want to compile from your text editor, you need to open your text editor from the same command line after calling vcvarsall.bat so that the editor "knows" the environment.

You can remove the ctime lines from build.bat, they are used to "monitor" the build times. Or you can compile ctime and add it to the path.

100 posts
Help with build
Edited by da447m on Reason: misread stuff
Replying to mrmixer (#25740)

Oh I've just noticed that I used powershell, now with cmd.exe as admin it is getting everything but ctime, so I just run the build script and added to path as you said.

Thanks it compiled[snip]

EDIT: ok I overlooked the instruction to run it in \build but with prompt in \handmade :)


PS: for any other noob that happens to stumble here:

C:\handmade\misc>.\shell
C:\handmade\ctime>.\build
C:\handmade\ctime>set path=C:\handmade\ctime;%path%
C:\handmade\code>.\build