On Mon, 2003-03-17 at 01:26, J. Scott Amort wrote:
> Hi,
>
> My apologies for posting this to the devel list, but I can't seem to
> find a users list. I hope someone might take the time to help me out.
>
> When I try to compile a program using log4cpp 0.3.4b that includes
> "Category.hh", I get the following error:
>
> /usr/local/include/log4cpp/Category.hh: In function `int main(int,
> char**)':
> /usr/local/include/log4cpp/Category.hh:623:
> `log4cpp::Category::Category(const
> log4cpp::Category&)' is private
> main.cc:33: within this context
When asking such questions its best to include the program you tried to
compile or even better an example as small as possible but still
reproducing the same error. Fortunately this one seems like an easy one
(for those who know :)). You're using Category's copy constructor which
is private. That is, you can't write something like
Category cat = Category::getInstance("some.name");
because this tries to take the object (reference) i returned by
getInstance() and construct a new oject cat from this object i, i.e.
this operation uses the copy constructor. Instead write
Category& cat = Category::getInstance("some.name");
(note the & to say "cat is a reference to a Category object). BTW IIRC
this question has already been answered either on this list or in one of
the forums.
HTH, Thomas.
>
> I'm running on a RH8.1 (Phoebe) box with gcc (GCC) 3.2.1 20021207 (Red
> Hat Linux 8.0 3.2.1-2). Any ideas? Thanks.
>
> Scott
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by:Crypto Challenge is now open!
> Get cracking and register here for some mind boggling fun and
> the chance of winning an Apple iPod:
> http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
> _______________________________________________
> Log4cpp-devel mailing list
> Log...@li...
> https://lists.sourceforge.net/lists/listinfo/log4cpp-devel
--
Thomas Maier (Tho...@un...)
|