Please take our Survey
logo       

Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

Re: building log4cxx: msg#00030

apache.logging.log4cxx.user

Subject: Re: building log4cxx

On Wed, Dec 13, 2006 at 04:39:40PM -0500, Bob Rossi wrote:
> On Wed, Dec 13, 2006 at 03:13:05PM -0500, Bob Rossi wrote:
> > On Tue, Dec 12, 2006 at 03:05:39PM -0500, Bob Rossi wrote:
> > > Hi,
> > >
> > > OK, I'm planning on using log4cxx, along with apr. Is there anything
> > > special I should consider? Can I simply have log4cxx use the libapr that
> > > I already build?
> >
> > I got it to this point,
> >
> > loglog.cpp: In static member function `static void
> > log4cxx::helpers::LogLog::emit(const std::wstring&)':
> >
> >
> > loglog.cpp:89: error: `wcerr' is not a member of `std'
> >
> > make[1]: *** [loglog.lo] Error 1
> >
> > make[1]: Leaving directory `/home/bobbybrasko/log4cxx/logging-log4cxx/src'
> >
> > make: *** [all-recursive] Error 1
> >
> >
> > This is on windows with mingw compiler, using autotools.
>
>
> Apparently, include/log4cxx/private/log4cxx_private.h has
> #define LOG4CXX_HAS_STD_WCOUT 1
> and loglog.cpp does
> #if LOG4CXX_HAS_WCHAR_T
> void LogLog::emit(const std::wstring& msg) {
> #if LOG4CXX_HAS_STD_WCOUT
> std::wcerr << L"log4cxx: " << msg << std::endl;
> #else
> LOG4CXX_ENCODE_CHAR(encoded, msg);
> std::cerr << "log4cxx: " << encoded << std::endl;
> #endif
> }
>
> If I comment out the WCOUT macro, I get,
> loglog.cpp: In static member function `static void
> log4cxx::helpers::LogLog::emit(const std::wstring&)':
>
>
> loglog.cpp:91: error: no matching function for call to
> `log4cxx::helpers::Transcoder::encode(const std::
> basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t>
> >&, std::string&)'
> ../include/log4cxx/helpers/transcoder.h:63: note: candidates are: static
> void log4cxx::helpers::Transcod
> er::encode(const log4cxx::LogString&, std::string&)
>
> ../include/log4cxx/helpers/transcoder.h:81: note: static
> void log4cxx::helpers::Transcod
> er::encode(const log4cxx::LogString&, std::wstring&)
>
> make[1]: *** [loglog.lo] Error 1
>
> make[1]: Leaving directory `/home/bobbybrasko/log4cxx/logging-log4cxx/src'
>
> make: *** [all-recursive] Error 1
>

It's a combination of 3 defines that are confused during the build
process. That is,
LOG4CXX_HAS_WCHAR_T
LOG4CXX_HAS_STD_WCOUT
LOG4CXX_LOGCHAR_IS_UTF8
the configure script says,
checking for wchar_t... yes
checking logchar type... utf-8

For some reason WCOUT is true, but mingw complains about it. Does mingw
support this? The problem code is here,

#if LOG4CXX_HAS_WCHAR_T
void LogLog::emit(const std::wstring& msg) {
#if LOG4CXX_HAS_STD_WCOUT
std::wcerr << L"log4cxx: " << msg << std::endl;
#else
LOG4CXX_ENCODE_CHAR(encoded, msg);
std::cerr << "log4cxx: " << encoded << std::endl;
#endif
}
#endif

Since wcerr isn't available, I've changed LOG4CXX_HAS_WCHAR_T to not be
defined. This calls the LOG4CXX_ENCODE_CHAR macro now. However, the
encode function looks like,
static void encode(const LogString& src, std::string& dst);
and LogString is defined as a char because of logchar type shown in the
configure above. In logstring.h,
#if LOG4CXX_LOGCHAR_IS_UTF8
typedef char logchar;
typedef std::basic_string<logchar> LogString;


So, log4cxx attempts to pass a wstring into a LogString, but a LogString
is a really string.

Please advise on how to fix this, and I'll sumbit a patch. If I've messe
up the ./configure line, please let me know.

Thanks,
Bob Rossi




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
hardware.arm.at...    cms.citadel.dev...    video.gstreamer...    java.facelets.u...    misc.basics.qna...    web.wiki.instik...    network.uip.use...    xdg.devel/2003-...    tex.bibtex.bibd...    finance.quotesp...    ietf.zeroconf/2...    redhat.blinux.g...    suse.db2/2003-0...    php.phpesp/2004...    uml.devel/2003-...    gnome.labyrinth...    qnx.openqnx.dev...    boot-loaders.gr...    db.dataperfect....    audio.audacity....    linux.uclinux.m...    editors.j.devel...    os.openbsd.tech...    kde.users.multi...   
Home | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation