Handmade Hero»Forums»Code
Darren Sweeney
2 posts
Rendering Engineer at Frostbite.
Building Handmade Hero
Edited by Darren Sweeney on Reason: Initial post
I'm trying to build handmade hero but get this error. I follow the instruction that was on the GitHub link, I'm using visual studio 2017. Does anyone have any ideas on how to fix this?

'ctime' is not recognized as an internal or external command,
operable program or batch file.
test_png.cpp
d:\handmade\code\handmade_types.h(351,18): error C3861: '_InterlockedExchange64': identifier not found
d:\handmade\code\handmade_types.h(358,18): error C3861: '_InterlockedExchangeAdd64': identifier not found
d:\handmade\code\handmade_types.h(364,36): error C3861: '__readgsqword': identifier not found
d:\handmade\code\handmade_shared.h(788,57): warning C4018: '<': signed/unsigned mismatch
d:\handmade\code\handmade_shared.h(809,65): warning C4018: '>': signed/unsigned mismatch
d:\handmade\code\handmade_shared.h(1005,14): warning C4244: 'argument': conversion from 'u64' to 'memory_index', possible loss of data
hhfont.cpp
Simon Anciaux
1337 posts
Building Handmade Hero
Which day are you trying to compile ? I can compile day 533 with VisualĀ Studio 2017 without warnings or errors.

For the ctime error, you can add ctime to the path or edit build.bat to add the full path to ctime.exe. The exe is in the zip in the ctime folder.
1
2
3
4
W:\handmade\ctime\ctime.exe -begin handmade_hero.ctm

REM At the end of the file
W:\handmade\ctime\ctime.exe -end handmade_hero.ctm %LastError%


Did you call vcvarsall.bat with x64 as an argument to compile for a 64bit target ? Something like:
1
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x64


It should display this if you do (important to have the 'x64' at the end).
1
2
3
4
5
**********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.4.1
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'


For the warnings you can add "-wd4018 -wd4244" to the CommonCompilerFlags in build.bat but it's probably better to fix those in the code.
Darren Sweeney
2 posts
Rendering Engineer at Frostbite.
Building Handmade Hero
So I did run vcvarsall.bat x64 originally and it showed Environment initialized for: 'x64' with no luck. I tried it from the ..\handmade\code directory and then it worked. I was unaware you had to run it from the handmade\code path.

Cheers for the reply!
Simon Anciaux
1337 posts
Building Handmade Hero
I should not matter where you call vcvarsall.bat as long as you don't close the console window. But you need to call build.bat from the code directory.