Initialization problem

This is a discussion on Initialization problem within the Apache forums in Application Servers & Tools category; Hi, I'm trying to use log4cxx for a project I'm working on. The problem is when I try to load the logger as described in the tutorial like this: LoggerPtr GluePairUnitDlg::logger(Logger::getLogger("gluepai runitdlg")); I get the following errors: gluepairunit.cpp:4: error: no matching function for call to 'log4cxx::Logger::getLogger(const char [16])' /usr/include/log4cxx/logger.h:295: note: candidates are: static log4cxx::LoggerPtr log4cxx::Logger::getLogger(const log4cxx::String&) /usr/include/log4cxx/logger.h:316: note: static log4cxx::LoggerPtr log4cxx::Logger::getLogger(const log4cxx::String&, log4cxx::spi::LoggerFactoryPtr) Now, If I change the loader for this: LoggerPtr GluePairUnitDlg::logger(Logger::getLogger(L"gluepa irunitdlg")); I get this error: gluepairunit.cpp:4: undefined reference to `log4cxx::Logger::getLogger(std::basic_string<wcha r_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&)' I try to use the Constructor of a string like this String ...

Go Back   Application Development Forum > Application Servers & Tools > Apache

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 09-17-2008, 06:35 AM
Alexander Rojas
Guest
 
Default Initialization problem

Hi,
I'm trying to use log4cxx for a project I'm working on. The problem is
when I try to load the logger as described in the tutorial like this:
LoggerPtr
GluePairUnitDlg::logger(Logger::getLogger("gluepai runitdlg"));

I get the following errors:

gluepairunit.cpp:4: error: no matching function for call to
'log4cxx::Logger::getLogger(const char [16])'
/usr/include/log4cxx/logger.h:295: note: candidates are: static
log4cxx::LoggerPtr log4cxx::Logger::getLogger(const
log4cxx::String&)
/usr/include/log4cxx/logger.h:316: note: static
log4cxx::LoggerPtr log4cxx::Logger::getLogger(const
log4cxx::String&, log4cxx::spi::LoggerFactoryPtr)

Now, If I change the loader for this:

LoggerPtr
GluePairUnitDlg::logger(Logger::getLogger(L"gluepa irunitdlg"));

I get this error:

gluepairunit.cpp:4: undefined reference to
`log4cxx::Logger::getLogger(std::basic_string<wcha r_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> > const&)'

I try to use the Constructor of a string like this

String tmp("gluepairunitdlg");
LoggerPtr GluePairUnitDlg::logger(Logger::getLogger(tmp));

And then I get this set of errors:

gluepairunit.cpp:4: error: no matching function for call to
'std::basic_string<wchar_t, std::char_traits<wchar_t>,
std::allocator<wchar_t> >::basic_string(const char [16])'
/usr/include/c++/4.2/bits/basic_string.tcc:233: note: candidates
are: std::basic_string<_CharT, _Traits,
_Alloc>::basic_string(typename
_Alloc::rebind<_CharT>:ther::size_type, _CharT, const _Alloc&)
[with _CharT = wchar_t, _Traits = std::char_traits<wchar_t>,
_Alloc = std::allocator<wchar_t>]
/usr/include/c++/4.2/bits/basic_string.tcc:226: note:
std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const
_CharT*, const _Alloc&) [with _CharT = wchar_t, _Traits =
std::char_traits<wchar_t>, _Alloc = std::allocator<wchar_t>]

And if I try this:

String tmp(L"gluepairunitdlg");
LoggerPtr GluePairUnitDlg::logger(Logger::getLogger(tmp));

The string is created perfectly but the call to get logger gives me:

gluepairunit.cpp:5: undefined reference to
`log4cxx::Logger::getLogger(std::basic_string<wcha r_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> > const&)'

I'm working on Ubuntu 8.04 Hardy, log4cxx version 0.9.7-6, gcc 4.2.3.
The IDE is kdevelop and the file is encoded as UTF-8.

I don't know if this is all the relevant information. Thank you for your
help

Alexander Rojas


Reply With Quote
  #2  
Old 09-17-2008, 12:03 PM
Curt Arnold
Guest
 
Default Re: Initialization problem


On Sep 17, 2008, at 5:35 AM, Alexander Rojas wrote:
> I'm working on Ubuntu 8.04 Hardy, log4cxx version 0.9.7-6, gcc 4.2.3.
> The IDE is kdevelop and the file is encoded as UTF-8.
>
> I don't know if this is all the relevant information. Thank you for
> your
> help
>
> Alexander Rojas
>



log4cxx 0.9.7 is obsolete and no longer supported. log4cxx 0.10.0 is
the current release.

Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 04:22 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.