S
sean345
While compiling my program I get the following g++ error:
error: no matching function for call to
`ErrorLog::file_error(std::string&, std::string&, const char[33])'
note: candidates are: void ErrorLog::file_error(const std::string&,
int, const std::string&)
The error line is:
log.file_error(filename, line, "variable is not assigned a value");
where filename is a std::string and line is an int. I do not
understand why the string literal will not convert to a const
std::string& as it does every other time I've used something like this.
This is the only error in the program and commenting out the line
above allows the program to compile successfully. Any suggestions?
- Sean
error: no matching function for call to
`ErrorLog::file_error(std::string&, std::string&, const char[33])'
note: candidates are: void ErrorLog::file_error(const std::string&,
int, const std::string&)
The error line is:
log.file_error(filename, line, "variable is not assigned a value");
where filename is a std::string and line is an int. I do not
understand why the string literal will not convert to a const
std::string& as it does every other time I've used something like this.
This is the only error in the program and commenting out the line
above allows the program to compile successfully. Any suggestions?
- Sean