I’m trying to use this C++ class as a base for my own application’s client/server communication. But it’s throwing an error I do not understand, it’s inside myLog.cpp.
error: invalid conversion from 'int' to 'std::_Ios_Openmode'|
Which is here:
void myLog::openLog(const string& fileName, int mode)
{
if (logLevel < QUIET_MODE)
{
open(fileName.c_str(),mode); //Error line
/* SNIP */
Which is called here:
void myLog::init()
{
openLog("syslog.log",LOG_WRITE);
}
And LOG_WRITE is defined in the header like so:
const int LOG_WRITE = ios::out;
Can anybody tell me why this is happening?
ios::outisn’tintbutstd::_Ios_Openmode.