Handmade Hero»Forums»Code
Mārtiņš Možeiko
2559 posts / 2 projects
Day 16 - Just so many errors
Edited by Mārtiņš Možeiko on
Yes, there is. Click right mouse button on file, choose Properties and then select "Yes" for "Excluded From Build".

But there is better option - add only Win32Handmade.cpp to project (remove all other files) and then select "Show All Files" button in solution explorer (8th from left).
Then Solution Explorer will show all files in folder instead of only those which are added to project. So you won't need to add anything else to project.
Gavin Williams
26 posts
Day 16 - Just so many errors
Edited by Gavin Williams on
So i removed all the other files from the project, and just built with Win32Handmade.cpp. And it ran again :D So I'll have to leave on 'Show All Files'

Weird thing tho, the line

1
tSine += 2.0f*Pi32 / wavePeriod;


still gives errors:

error C2059: syntax error : '='
error C2143: syntax error : missing ';' before '/'

But i have the Pi32 define before the Handmade.cpp include.

Edit: changed the Pi32 define to read:

#define Pi32 3.14159265359f instead of
#define Pi32 = 3.14...;
Mārtiņš Možeiko
2559 posts / 2 projects
Day 16 - Just so many errors
If you have define like this:
1
#define Pi32 = 3.14159265359f;

Then following code:
1
tSine += 2.0f*Pi32 / wavePeriod;

will get expanded to:
1
tSine += 2.0f*= 3.14159265359f; / wavePeriod;


You see what is wrong there?
#define's are simple text replacements. You need to have correct text replacement for Pi32 to make it work:
1
#define Pi32 3.14159265359f
Gavin Williams
26 posts
Day 16 - Just so many errors
Thanks guys for holding my hand through all that. I feel reasonably incompetent. But glad I've got a running project again. Onto day 17.