Hi,
With a recent upgrade to log4cpp 0.3.4b, and a new gentoo linux system
using g++3.2, i can no longer get a simple example to compile. The error is;
/usr/local/log4cpp-0.3.3/include/log4cpp/Category.hh: In static member
function
`void __static_initialization_and_destruction_0(int, int)':
/usr/local/log4cpp-0.3.3/include/log4cpp/Category.hh:624: `
log4cpp::Category::Category(const log4cpp::Category&)' is private
test.cc:15: within this context
This compiles fine with log4cpp 0.2.5 under debian using g++2.95.4. I
have tried a trivial example moving everything into main as in
testmain.cpp from the examples directory, which compiles and runs fine.
Can someone point out what im doing wrong, or perhaps how i should be
setting up so each class can log effeciently.
#include "log4cpp/Category.hh"
class A
{
public:
A() ;
~A() ;
void testMethod() ;
static log4cpp::Category main_cat ;
};
log4cpp::Category A::main_cat = log4cpp::Category::getRoot() ;
A::A()
{}
void A::testMethod()
{
main_cat.log(log4cpp::Priority::ERROR, "This is a test!");
}
A::~A()
{}
int main(int argc, char* argv[])
{
A a ;
a.testMethod() ;
return (0);
}
Thanks for any help,
~Colin.
|