| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| 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 |
|
#2
| |||
| |||
| 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. |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.