Handmade Hero»Forums»Code
Dafydd Brown
5 posts
Source code access
Hey,

To get the latest version of the source, do I have to just revisit the same link after placing my order? I hadn't made a bookmark, but thankfully I never clear my history :D


/* Offtopic */
Thanks for doing this whole series. It's very awesome and exactly what iv'e been looking for for a while now, but never had the time to deal with the nuts and bolts of such a low level approach.
I am a programmer (I work as an asp .net c#(rather easy to use) web app developer) but my passion has always been gfx (demo scene (coding gfx for the fun of it) type effects). For that type of stuff iv'e always relied on wrappers and libraries and obscure languages(such as Blitz Basic(i.k.r) and Freebasic) rather than directly accessing buffers and memory and all that jazz.

I've been trying to compile the code in VS C.13 but I can't seem to set it up correctly. I setup an empty win32 proj with empty everything, then added the source and headers, but when I try to buld, I just get a bunch of syntax errors mainly to do with the pointers to the typedefs such as

int16 *Samples;
error C2143: syntax error : missing ';' before '*'

Any idea what i'm doing wrong, or better still any chance of a solution :D or would you simple recommend doing it the way you setup. I was hoping to use VS as my editor as well as compiler (as I use it everyday for asp.net)

Thanks!

DB
Marco
10 posts
Source code access
Edited by Marco on
Yes, the link it's always the same. It gets updated with the new code shortly after the end of each stream. You should have the link also in the confirmation email that you received. Hopefully you haven't deleted that as well :)

For the build, I suggest you use the build.bat file provided with the code and use VS just for debug. If you really want to use VS, you might need to add some libraries in the project configuration for the linker to work correctly. I can have a look once I'm on my windows machine.
Dafydd Brown
5 posts
Source code access
marco.castorina
Yes, the link it's always the same. It gets updated with the new code shortly after the end of each stream. You should have the link also in the confirmation email that you received. Hopefully you haven't deleted that as well :)


Ah great thanks! I didn't even notice that email (I skim over the subjects too much clearly)


marco.castorina

For the build, I suggest you use the build.bat file provided with the code and use VS just for debug. If you really want to use VS, you might need to add some libraries in the project configuration for the linker to work correctly. I can have a look once I'm on my windows machine.


Ok, so I gave that a go and got it to compile, I can still use VS to edit which is all I really wanted to do. I added call "build.bat" to shell.bat and made it start up in the code directory.

Thanks for the advice and help, much appreciated :)
Mārtiņš Možeiko
2559 posts / 2 projects
Source code access
@tetradb: check if your error is same as here: https://forums.handmadehero.org/i...hp/forum?view=topic&catid=4&id=21
If so, just exclude file from build, because Casey is doing unity builds.
Dafydd Brown
5 posts
Source code access
Thanks for the link, it was a similar error, but it did quite fully resolve my issues.

So I tried to go back to an earlier version of the source code, and after some messing it turns out I had two problems.
The first is that I made an empty Console project instead of a Windows project.

With that out of the way the second issue I had was
argument 2 from 'char [10]' to 'LPCWSTR'
which turned out to be a project default setting.

So I changed Project->Properties then choose 'All Configurations' from the Configuration drop down, then
Configuration Properties->General and under Project Defaults change Character Set from 'Use Unicode Character Set' to 'Not Set'.

Now it compiles and runs fine.

There is a massive difference in the executable size though, using the Build.bat produces a 180kb exe file, where as VS Debug produces a 34kb and Release a 9kb exe file. Does that mean that the VS version requires external DLLs to run?

Thanks for the help :)
Mārtiņš Možeiko
2559 posts / 2 projects
Source code access
Edited by Mārtiņš Možeiko on
Yes, by default Visual Studio projects links executables dynamically with C/C++ runtime libraries. This means that your exe will depend on msvcr120.dll and msvcp120.dll in Release config, or msvcr120d.dll and msvcp120d.dll for Debug config.

To link all runtime code into executable statically you need to change Runtime Library option in Project Settings (under C/C++ -> Code Generation). Set it to "Multi threaded" for Release config and "Multi threaded debug" for Debug config (make sure there is no DLL in option name).
Dafydd Brown
5 posts
Source code access
Ah great thanks very much for the info!