If you're running the application from within something like the Code::Blocks IDE then it will sandbox your app in it's own shell, this is where the error code 3 is coming from. So let us know what environment you're programming in and we can direct you to the error code definition.
My mistake, the error code 3 might be coming from SDL, in which case it could mean a Segmentation fault. It's been a few years since I've looked at SDL so this might take me a minute if someone else doesn't beat me to it.
Sorry about the bumping but I want to make sure the OP sees this.
@ OP: Also make sure you are linking to the .c\.cpp files properly, in C::B this is done through "Project -> Add Files". The header file is enough for a forward declaration but if your compiler doesn't know to process the other source code files it will only have entries in the look-up table that don't go anywhere.