The toolchain (well, GCC really) often throws a hissy fit for stupid, little easy-to-miss mistakes. Try declaring your main function with parameters. Instead of just "int main()", do "int main(int argc, char *argv)". I've had such errors that got fixed by declaring with parameters, hope this works for you as well!
EDIT: Just noticed: You're including stdio.h? I'm more familiar with C than C++, but I think C libraries are named differently in C++, so to import <stdio.h>, you'd import <cstdio> instead. I'm also pretty sure you're using functions from stdlib in there ("cstdlib" in C++).
EDIT 2: Disclaimer: I may be way off, it's 4 AM here and I'm tired as hell.