Hi,
I want to initialize two static data members. See the two files
//Logger.h
class Logger{
public:
static LoggerConcrete error;
static LoggerConcrete write;
};
and
//Logger.cpp
Logger::error = LoggerConcrete(LOG_DEBUG);
Logger::write = LoggerConcrete(LOG_DEBUG);
The initilization of the two static members in Logger.cpp doesn't work. I get the following compiler (g++) error:
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"Logger.d" -MT"Logger.d" -o"Logger.o" "../Logger.cpp" ../Logger.cpp:13: error: expected constructor, destructor, or type conversion before '=' token ../Logger.cpp:14: error: expected constructor, destructor, or type conversion before '=' token
I want to use Logger::write and Logger::error in each class in which I include Logger.h. How do I have to initialize these two members?