i'm doing an exercise from the deitel c++ book. i think i have the implementation figured out, but i'm having some errors when i try to compile it. i'm getting "[linker errror] undefined reference to" for each of the SavingsAccount and CheckingAccount class constructors as well as one for every function in the account class. i've checked to make sure all the #include's are there and all the files are in the same folder but no luck. anyways, here's my code (new here, sorry if the formatting is off.)
Make sure you're compiling everything correctly. If you're using an IDE, for example Code::Blocks, Dev-C++, MSVC++, etc., creating a project and adding all .h and .cpp files should properly compile this. If you're compiling by hand, using the command line, you will first need to compile each class, .h and .cpp, and then compile the outputs of them with main.cpp.
I'm using dev-c++ and putting it all into a project worked, thanks so much. I never had to use a project file before since it all compiled just fine without it (though it was never more than one header file). is there specific requirements for when they must be used?
General rule of thumb, if there is more than one .cpp file, the projects will help you compile accurately. However, I do not recommend using dev-C++ and highly suggest getting rid of it. It has a simple design, but has many flaws. You should always use a project so that all files related to that program are only a click away and so that it keeps everything organized a little better.
There are some exceptions of the general rule, including templates, but you'll learn over time.
If you're wondering, I suggest Code::Blocks. A new version was just release two weeks ago: http://www.codeblocks.org/downloads/26. Make sure you download the mingw-setup version or you won't be able to compile any code (unless you know what you're doing).