Are you using an IDE to help link/compile your code or are you working without an IDE? If without an IDE, how are you trying to compile it? If you're using an IDE, which is it?
As an aside: try to get into the habit of only having #includes when you need them. ex: You shouldn't need #include <iostream> in your main file (or using namespace std either, there's nothing in your main function that uses std::).
Are you using an IDE to help link/compile your code or are you working without an IDE? If without an IDE, how are you trying to compile it? If you're using an IDE, which is it?
code blocks
As an aside: try to get into the habit of only having #includes when you need them. ex: You shouldn't need #include <iostream> in your main file (or using namespace std either, there's nothing in your main function that uses std::).