Hey, another confused beginner here looking for some help. Didn't sleep for a while so might just be brain freezing but need to finish my assignments tonight and can't seem to figure out the problem here.
The error message i get is "undefined reference to `Cat::Cat(std::string, std::string, int)" when I try to create my class object with the overload constructor. What am I missing?
When you linked, did you definitely link the object file that was made by compiling katt4.cpp ? (trick question; no, you did not)
Because there's nothing wrong with this code (except for a missing brace and so on that I expect is a cut and paste error). So basically, the object file that gets made when you compile katt4.cpp isn't being made, or it isn't being linked with the object file that gets made when you compile main.cpp
Your code is main.cpp is "looking" for the constructor code, and it can't find it.
If you're using an IDE, I expect that you haven't put all these files into your "project" or whatever your IDE calls it.
If you're building it yourself at the command line, the following build command works perfectly, so you must be missing katt4.cpp
Thank you for your response! I created the project with the main.cpp file and then added both files to it, so they are in the same project. :/ Im using Codeblocks 13.12!
I'm not familiar with your IDE, but this is a problem of telling your IDE what files you want it to compile and link, rather than a problem with your actual code.
If I recall, when you conduct a build with Code::Blocks, there is an output window that effectively lists all the command being executed. You could look in that and see if it is (or is not) compiling and linking katt4.cpp