Here is some example code I read from some tutorial:
int main(int argc, char* argv[])
{
log4cpp::OstreamAppender* osAppender = new log4cpp::OstreamAppender("osAppender", &cout);
osAppender->setLayout(new log4cpp::BasicLayout());
log4cpp::Category& root = log4cpp::Category::getRoot();
root.addAppender(osAppender);
root.setPriority(log4cpp::Priority::DEBUG);
root.error("Hello log4cpp in a Error Message!");
root.warn("Hello log4cpp in a Warning Message!");
log4cpp::Category::shutdown();
getchar();
return 0;
}
Error report:
Unhandled exception at 0x76fe15de of log4cpp_Test.exe: 0xC0000005: Access violation wile reading 0x00000024
What might have caused the error ?