I am trying to compiles this small code but got the private member access eoor. I am using visual studio 2008. I downloaded the latest version of log4cpp code and has been successful to make a lib and dll for myself. But for my own app, I am scatching my head. Can anyone help?
Error 1 error C2248: 'log4cpp::Category::Category' : cannot access private member declared in class 'log4cpp::Category' c:\experiment\simpleconsoleapplication\simpleconsoleapplication\simplehelloworld.cpp 38 SimpleConsoleApplication
int main(int argc, char* argv[])
{
int ret = 1;
std::string dbFileMame = "c:\\temp\\emailAddress.db";
std::string emailDomain = "c:\\temp\\emailDomain.db";
std::string emailPart = "c:\\temp\\emailPart.db";
std::string progressLog = "c:\\temp\\progress.log";
//Logging exp just play around the api
log4cpp::Appender* app = new log4cpp::FileAppender("FileAppender",progressLog);
log4cpp::Layout* layout = new log4cpp::BasicLayout();
app->setLayout(layout);
log4cpp::Category main_cat = log4cpp::Category::getInstance("");
}
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am trying to compiles this small code but got the private member access eoor. I am using visual studio 2008. I downloaded the latest version of log4cpp code and has been successful to make a lib and dll for myself. But for my own app, I am scatching my head. Can anyone help?
Error 1 error C2248: 'log4cpp::Category::Category' : cannot access private member declared in class 'log4cpp::Category' c:\experiment\simpleconsoleapplication\simpleconsoleapplication\simplehelloworld.cpp 38 SimpleConsoleApplication
#include <iostream>
#include <string>
#include "Category.hh"
#include "FileAppender.hh"
#include "BasicLayout.hh"
int main(int argc, char* argv[])
{
int ret = 1;
std::string dbFileMame = "c:\\temp\\emailAddress.db";
std::string emailDomain = "c:\\temp\\emailDomain.db";
std::string emailPart = "c:\\temp\\emailPart.db";
std::string progressLog = "c:\\temp\\progress.log";
//Logging exp just play around the api
log4cpp::Appender* app = new log4cpp::FileAppender("FileAppender",progressLog);
log4cpp::Layout* layout = new log4cpp::BasicLayout();
app->setLayout(layout);
log4cpp::Category main_cat = log4cpp::Category::getInstance("");
}
sorry my bad:
the last line should be log4cpp::Category& main_cat = log4cpp::Category::getInstance("");
a reference because of a private copy constructor