logging-log4cxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Zhou Tao <zhoutao...@gmail.com>
Subject Re: Build fail on AIX using XLC compiler
Date Tue, 20 Oct 2009 08:17:23 GMT
Experts,

I looked through the simpledateformat.h header file and made the below
change and the build of simpledateformat.cpp passed. It looks like the below
syntax to use the std::locale class causes the problem when enable the
-D_LARGE_FILES compiler flag for AIX XLC.

change the below:
namespace std { class locale; }

to be:
using std::locale;

or to be:
#if LOG4CXX_HAS_STD_LOCALE
#include <locale>
#endif

Then the build of simpledateformat.cpp succeed. Is there some reason to use
the std::locale this way? To support multi-platforms? Or someone could
provide a formal fix based on my change?
 BTW, my building env:
CC = xlc_r
CXX = xlC_r
CFLAGS = -q64 -D_LARGE_FILES -qarch=ppc64 -qsmp
CXXFLAGS= -q64 -D_LARGE_FILES -qarch=ppc64 -qsmp -qpic=large
LDFLAGS = -q64 -qsmp -brtl -bbigtoc

Thanks,
Tom
2009/9/29 Zhou Tao <zhoutao109@gmail.com>

> Hi all,
>
> I am building log4cxx on AIX using XLC as the compiler. And I turn on the
> -D_LARGE_FILES compiler flag for our purpose. However seems that log4cxx
> dislikes the compiler flag. I could build APR, APR-UTIL and when I build
> log4cxx, errors happen when build the simpledateformat.cpp file. The error
> message is the following,
>
> /bin/sh ../../../libtool --tag=CXX --mode=compile /usr/vacpp/bin/xlC_r
> -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\"
> -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"log4cxx\"
> -DVERSION=\"0.10.0\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1
> -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1
> -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1
> -DHAVE_DLFCN_H=1 -DHAVE_MBSRTOWCS=1 -DHAVE_WCSTOMBS=1 -DHAVE_SYSLOG=1
> -DHAVE_FWIDE=1  -I. -I. -I../../../src/main/include
> -I../../../src/main/include  -I/usr/vacpp/include  -U__STR__ -D_THREAD_SAFE
> -D_USE_IRS
> -I/usr/u/tzhou/log4cxx_build/aixibmp64/nodebug/install/apr/include/apr-1
> -I/usr/u/tzhou/log4cxx_build/aixibmp64/nodebug/install/apr-util/include/apr-1
> -q64 -D_LARGE_FILES -qlonglong -c -o simpledateformat.lo
> simpledateformat.cpp
>  /usr/vacpp/bin/xlC_r -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\"
> -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\"
> -DPACKAGE=\"log4cxx\" -DVERSION=\"0.10.0\" -DSTDC_HEADERS=1
> -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1
> -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1
> -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DHAVE_MBSRTOWCS=1 -DHAVE_WCSTOMBS=1
> -DHAVE_SYSLOG=1 -DHAVE_FWIDE=1 -I. -I. -I../../../src/main/include
> -I../../../src/main/include -I/usr/vacpp/include -U__STR__ -D_THREAD_SAFE
> -D_USE_IRS
> -I/usr/u/tzhou/log4cxx_build/aixibmp64/nodebug/install/apr/include/apr-1
> -I/usr/u/tzhou/log4cxx_build/aixibmp64/nodebug/install/apr-util/include/apr-1
> -q64 -D_LARGE_FILES -qlonglong -c -M simpledateformat.cpp  -DPIC -o
> .libs/simpledateformat.o
> "simpledateformat.cpp", line 735.15: 1540-1118 (S) The declaration of
> "defaultLocale" uses the undefined class "std::locale" when the class must
> be complete.
> "simpledateformat.cpp", line 124.25: 1540-0218 (S) The call does not match
> any parameter list for
> "std::has_facet<std::_LFS_ON::time_put<wchar_t,std::ostreambuf_iterator<wchar_t,std::char_traits<wchar_t>
> > > >".
> "/usr/vacpp/include/locale", line 194.14: 1540-1283 (I)
> "std::_LFS_ON::has_facet<std::_LFS_ON::time_put<wchar_t,std::ostreambuf_iterator<wchar_t,std::char_traits<wchar_t>
> > > >(const locale &)" is not a viable candidate.
> "simpledateformat.cpp", line 124.35: 1540-0256 (I) A parameter of type
> "const std::_LFS_ON::locale &" cannot be initialized with an expression of
> type "const std::locale".
> "simpledateformat.cpp", line 125.63: 1540-0218 (S) The call does not match
> any parameter list for
> "std::use_facet<std::_LFS_ON::time_put<wchar_t,std::ostreambuf_iterator<wchar_t,std::char_traits<wchar_t>
> > > >".
> "/usr/vacpp/include/xlocale", line 293.19: 1540-1283 (I)
> "std::_LFS_ON::use_facet<std::_LFS_ON::time_put<wchar_t,std::ostreambuf_iterator<wchar_t,std::char_traits<wchar_t>
> > > >(const locale &)" is not a viable candidate.
> "simpledateformat.cpp", line 125.73: 1540-0256 (I) A parameter of type
> "const std::_LFS_ON::locale &" cannot be initialized with an expression of
> type "const std::locale".
> "simpledateformat.cpp", line 136.25: 1540-0218 (S) The call does not match
> any parameter list for
> "std::has_facet<std::_LFS_ON::time_put<char,std::ostreambuf_iterator<char,std::char_traits<char>
> > > >".
> "/usr/vacpp/include/locale", line 194.14: 1540-1283 (I)
> "std::_LFS_ON::has_facet<std::_LFS_ON::time_put<char,std::ostreambuf_iterator<char,std::char_traits<char>
> > > >(const locale &)" is not a viable candidate.
> "simpledateformat.cpp", line 136.35: 1540-0256 (I) A parameter of type
> "const std::_LFS_ON::locale &" cannot be initialized with an expression of
> type "const std::locale".
> "simpledateformat.cpp", line 137.60: 1540-0218 (S) The call does not match
> any parameter list for
> "std::use_facet<std::_LFS_ON::time_put<char,std::ostreambuf_iterator<char,std::char_traits<char>
> > > >".
> "/usr/vacpp/include/xlocale", line 293.19: 1540-1283 (I)
> "std::_LFS_ON::use_facet<std::_LFS_ON::time_put<char,std::ostreambuf_iterator<char,std::char_traits<char>
> > > >(const locale &)" is not a viable candidate.
> "simpledateformat.cpp", line 137.70: 1540-0256 (I) A parameter of type
> "const std::_LFS_ON::locale &" cannot be initialized with an expression of
> type "const std::locale".
> make[3]: *** [simpledateformat.lo] Error 1
>
> Any insight for this issue is greatly appreciated.
> Tom
>



-- 
Thanks and Regards,
Tom

Mime
View raw message