You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4cxx-user@logging.apache.org by "EXT / ALTIOR POINTE Jean-Baptiste (I&R)" <ex...@sncf.fr> on 2005/12/16 13:55:54 UTC

Pb while compiling log4cxx with MinGW


Hello, 

I'm trying to compile log4cxx with MinGW and I fail.

I've the necessary tools:

CYGWIN 1.4
MinGW 3.1.0
autocong 2.59
automake 1.9.5
libtools 1.5.18


'./autogen.sh' and './configure --disable-doxygen --with-thread=Microsoft --without-XML -without-ODBC --without-SMTP'
works fine but after that, 'make' fails.

It seems that almost all of the errors come from /helpers/tchar.h and from /spi/loggingevent.h as described as follow :



$ make
Making all in docs
c:\MinGW\bin\make.exe[1]: Entering directory `d:/Linux/log4cxx-0.9.7/docs'
c:\MinGW\bin\make.exe[1]: Nothing to be done for `all'.
c:\MinGW\bin\make.exe[1]: Leaving directory `d:/Linux/log4cxx-0.9.7/docs'
Making all in src
c:\MinGW\bin\make.exe[1]: Entering directory `d:/Linux/log4cxx-0.9.7/src'
if C:/cygwin/bin/sh.exe ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H
-I. -I. -I../include/log4cxx -I../include    -g -O2 -MT appenderattachableimpl.l
o -MD -MP -MF ".deps/appenderattachableimpl.Tpo" -c -o appenderattachableimpl.lo
 appenderattachableimpl.cpp; \
then mv -f ".deps/appenderattachableimpl.Tpo" ".deps/appenderattachableimpl.Plo"
; else rm -f ".deps/appenderattachableimpl.Tpo"; exit 1; fi
mkdir .libs
 g++ -DHAVE_CONFIG_H -I. -I. -I../include/log4cxx -I../include -g -O2 -MT append
erattachableimpl.lo -MD -MP -MF .deps/appenderattachableimpl.Tpo -c appenderatta
chableimpl.cpp  -DPIC -o .libs/appenderattachableimpl.o
In file included from appenderattachableimpl.cpp:17:
../include/log4cxx/helpers/tchar.h:45: parse error before `&' token
../include/log4cxx/helpers/tchar.h:54: parse error before `&' token
../include/log4cxx/helpers/tchar.h:55: `static void Convert::int64ToString(...)
   ' and `static void Convert::int64ToString(...)' cannot be overloaded
../include/log4cxx/helpers/tchar.h: In static member function `static void
   Convert::int64ToString(...)':
../include/log4cxx/helpers/tchar.h:48: `dst' undeclared (first use this
   function)
../include/log4cxx/helpers/tchar.h:48: (Each undeclared identifier is reported
   only once for each function it appears in.)
../include/log4cxx/helpers/tchar.h:48: `maxlen' undeclared (first use this
   function)
../include/log4cxx/helpers/tchar.h:48: `ll' undeclared (first use this
   function)
../include/log4cxx/helpers/tchar.h: At global scope:
../include/log4cxx/helpers/tchar.h:68: parse error before `&' token
../include/log4cxx/helpers/tchar.h:69: `std::basic_ostream<_CharT, _Traits>&
   std::operator<<(...)' must have an argument of class or enumerated type
../include/log4cxx/helpers/tchar.h:69: `std::basic_ostream<_CharT, _Traits>&
   std::operator<<(...)' must take exactly two arguments
In file included from appenderattachableimpl.cpp:20:
../include/log4cxx/spi/loggingevent.h:109: ISO C++ forbids declaration of `
   int64_t' with no type
../include/log4cxx/spi/loggingevent.h:109: parse error before `(' token
../include/log4cxx/spi/loggingevent.h: In member function `const
   log4cxx::LevelPtr& log4cxx::spi::LoggingEvent::getLevel() const':
../include/log4cxx/spi/loggingevent.h:93: `level' undeclared (first use this
   function)
../include/log4cxx/spi/loggingevent.h: In member function `const
   log4cxx::String& log4cxx::spi::LoggingEvent::getMessage() const':
../include/log4cxx/spi/loggingevent.h:100: `message' undeclared (first use this

   function)
../include/log4cxx/spi/loggingevent.h: At global scope:
../include/log4cxx/spi/loggingevent.h:114: ISO C++ forbids defining types
   within return type
../include/log4cxx/spi/loggingevent.h:114: long, short, signed or unsigned
   invalid for `getThreadId'
../include/log4cxx/spi/loggingevent.h:114: non-member function `
   log4cxx::spi::LoggingEvent log4cxx::spi::getThreadId()' cannot have `const'
   method qualifier
../include/log4cxx/spi/loggingevent.h:114: semicolon missing after declaration
   of `class log4cxx::spi::LoggingEvent'
../include/log4cxx/spi/loggingevent.h: In function `int
   log4cxx::spi::getThreadId()':
../include/log4cxx/spi/loggingevent.h:114: `threadId' undeclared (first use
   this function)
../include/log4cxx/spi/loggingevent.h: At global scope:
../include/log4cxx/spi/loggingevent.h:117: syntax error before `(' token
../include/log4cxx/spi/loggingevent.h:122: non-member function `char*
   log4cxx::getFile()' cannot have `const' method qualifier
../include/log4cxx/spi/loggingevent.h: In function `char* log4cxx::getFile()':
../include/log4cxx/spi/loggingevent.h:122: `file' undeclared (first use this
   function)
../include/log4cxx/spi/loggingevent.h: At global scope:
../include/log4cxx/spi/loggingevent.h:126: non-member function `int
   log4cxx::getLine()' cannot have `const' method qualifier
../include/log4cxx/spi/loggingevent.h: In function `int log4cxx::getLine()':
../include/log4cxx/spi/loggingevent.h:126: `line' undeclared (first use this
   function)
../include/log4cxx/spi/loggingevent.h: At global scope:
../include/log4cxx/spi/loggingevent.h:133: non-member function `const
   log4cxx::String& log4cxx::getNDC()' cannot have `const' method qualifier
../include/log4cxx/spi/loggingevent.h:136: non-member function `void
   log4cxx::write(log4cxx::helpers::SocketOutputStreamPtr&)' cannot have `const
   ' method qualifier
../include/log4cxx/spi/loggingevent.h:138: non-member function `void
   log4cxx::writeLevel(log4cxx::helpers::SocketOutputStreamPtr&)' cannot have `
   const' method qualifier
../include/log4cxx/spi/loggingevent.h:158: non-member function `log4cxx::String

   log4cxx::getMDC(const log4cxx::String&)' cannot have `const' method
   qualifier
../include/log4cxx/spi/loggingevent.h:167: non-member function `
   std::set<log4cxx::String, std::less<log4cxx::String>,
   std::allocator<log4cxx::String> > log4cxx::getMDCKeySet()' cannot have `
   const' method qualifier
../include/log4cxx/spi/loggingevent.h:173: non-member function `void
   log4cxx::getMDCCopy()' cannot have `const' method qualifier
../include/log4cxx/spi/loggingevent.h:178: non-member function `log4cxx::String

   log4cxx::getProperty(const log4cxx::String&)' cannot have `const' method
   qualifier
../include/log4cxx/spi/loggingevent.h:185: non-member function `
   std::set<log4cxx::String, std::less<log4cxx::String>,
   std::allocator<log4cxx::String> > log4cxx::getPropertyKeySet()' cannot have
   `const' method qualifier
../include/log4cxx/spi/loggingevent.h:192: parse error before `public'
../include/log4cxx/spi/loggingevent.h:245: 'int64_t' is used as a type, but is
   not defined as a type.
../include/log4cxx/spi/loggingevent.h:248: `char*log4cxx::file' used prior to
   declaration
../include/log4cxx/spi/loggingevent.h:252: `int log4cxx::line' used prior to
   declaration
../include/log4cxx/spi/loggingevent.h:259: syntax error before `;' token
../include/log4cxx/spi/loggingevent.h:261: parse error before `}' token
c:\MinGW\bin\make.exe[1]: *** [appenderattachableimpl.lo] Error 1
c:\MinGW\bin\make.exe[1]: Leaving directory `d:/Linux/log4cxx-0.9.7/src'
c:\MinGW\bin\make.exe: *** [all-recursive] Error 1



Thanks in advance,


JB



Re: Pb while compiling log4cxx with MinGW

Posted by Andreas Fester <af...@apache.org>.
Hi,

Which package do you use?

> c:\MinGW\bin\make.exe[1]: Entering directory `d:/Linux/log4cxx-0.9.7/docs'

This looks like you are using the outdated 0.9.7 version.
You should probably consider using the currently work-in-progress
version  0.9.8. Try the package from
http://www.littletux.net/log4cxx/log4cxx-0.9.8.tar.gz

Regards,

	Andreas

 EXT / ALTIOR POINTE Jean-Baptiste (I&R) wrote:
> 
> 
> Hello,
> 
> I'm trying to compile log4cxx with MinGW and I fail.
> 
> I've the necessary tools: