Handmade Hero » Forums » Code » Building Handmade Hero
DarrenSweeney
Darren Sweeney
5 posts

Rendering Engineer at Frostbite.

#21058 Building Handmade Hero
1 month, 1 week ago Edited by Darren Sweeney on May 19, 2019, 11:53 a.m. 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
mrmixer
Simon Anciaux
618 posts
#21060 Building Handmade Hero
1 month, 1 week ago

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.
DarrenSweeney
Darren Sweeney
5 posts

Rendering Engineer at Frostbite.

#21061 Building Handmade Hero
1 month, 1 week ago

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!
mrmixer
Simon Anciaux
618 posts
#21067 Building Handmade Hero
1 month, 1 week ago

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.