Handmade Hero » Forums » Code » Day 011
12 posts
#2742 Day 011
2 years, 1 month ago

Sorry guys, Iam just in day 11 with the Hero, I got a problem with the compilation in VS12

this appear to be the error (the internal instruction in handmade.cpp and .h)

INTERNAL void GameUpdateAndRender(game_offscreen_buffer *Buffer, int BlueOffset, int GreenOffset);

Error 1 error C2144: syntax error : 'void' should be preceded by ';'
Error 2 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

do you know what is it?

Ruy Calderon
25 posts
#2743 Day 011
2 years, 1 month ago

It looks like it's either getting an error from the previous line or you have a typo in that current line. Are you sure you have your #define set as:

#define INTERNAL static

and not

#define internal static

Other than that I can't be of much more use without seeing the previous lines of code, but from my personal experience with handmade hero, when I get errors like that it's usually silly things like a typo or forgetting a semicolon on the line before.
12 posts
#2744 Day 011
2 years, 1 month ago

Thanks StarchyPancakes, but I didn't touch the original code just paste from the download...

I don't what happened
Ruy Calderon
25 posts
#2745 Day 011
2 years, 1 month ago

In that case I'm out of ideas, sorry I couldn't be of more help.
Kasper Sauramo
19 posts
#2748 Day 011
2 years, 1 month ago

Well there is no INTERNAL in the source, only internal. I'd suggest making sure you did copy paste everything right (use a diff tool if you can) or just double check by hand for missing braces and semi-colons. I had something similar, took me 2 hours to find by hand where a diff tool could've cought it a lot faster.

This signature is reserved and must be NULL
Iker Murga
43 posts
#2749 Day 011
2 years, 1 month ago Edited by Iker Murga on Feb. 18, 2015, 1:29 a.m.

I had a similar error whenever I tried compiling handmade hero during the first few weeks, due to using an older version of visual studio that didn't have all the headers Casey was using... however in my case I believe it was stdint.h that was missing, which would have caused the same error on day 10.

If you haven't tried compiling every day before 11 test it to make sure the error begins on day 11, and then try and figure out what is missing (and if you can, upgrade to vs community..)
Roderic Bos
69 posts
#2757 Day 011
2 years, 1 month ago

You have to set hanmadeinternal as compiler flag, or else it'll fail. Search the forum for a correct vs solution file. And remember to build 64 bit!
1 posts
#10883 Day 011
1 month, 1 week ago

Ran into the same problem myself. The solution was to create a header file called "define.h", and move all of the #defines and typedefs to there. Then I just include the define.h file at the top of handmade.h.

Plus this way there's no need to fiddle with compiler parameters (since I'm using XCode anyway).