As a general rule you should stick to files within public/.
The current example doesn't compile because the definition of UTIL_BloodSpray is inside a .cpp file someone in the sdk, and isn't being compiled into your project. You really don't want to add this cpp file to the project as the code within it probably won't match the current game.
The 3 main solutions for this are (in order of preference):
1) Find the definition and reimplement it using code you can access.
2) Lookup the compiled definition of the code inside the valve binary at runtime, known as signature scanning. Lots of information on this around the forums/wiki.
3) Linux only, add the server/engine binaries to your link path and let the loader do the equivalent of signature scanning for you.