Need help with an Error Message.

When I compile the program I get the error message "no matching function to call to" and I know it has something to do with the class object. If anyone could help me with this, I would truly appreciate it.
Last edited on
using namespace std;
Never ever put this in a header file.


1
2
3
#include "Cake.cpp"
#include "Date.cpp"
#include "GraduationCake.cpp" 

#include ing a *.cpp file is usually a big mistake and indicates a massive misunderstanding of what you're doing.


Cake mycake(flavor_input, weight_input);
This is an attempt to create a Cake object using the following constructor:
Cake::Cake(string cakeFlavor, double cakeWeight)
but that constructor doesn't exist. You can't use functions that don't exist.
I see that @Repeater found the problem, but in the future, please (always) post the entire error message.

The message "no matching function for call to" is just some nonsense sentence fragment. The compiler doesn't emit that and sit quietly, but also produces plenty of invaluable context about the problem, including, at least, the exact location of the error.

Sharing the whole message prevents us from having to munge or compile six or so files just to locate the issue. Help us help you.
Last edited on
@OP Why did you delete your code? How can we help you if you do that?
Topic archived. No new replies allowed.