4

I am trying to build Log4cxx-0.10.0 on Mac OS X Yosemite(Xcode 6.3.1).

I ran

cd thirdparty/apr-1.4.6/
CC="gcc -m32" ./configure
make
cd thirdparty/apr-util-1.5.2/
CC="gcc -m32" ./configure --with-apr=../apr-1.4.6/ --without-ldap
make
sudo make install
cd thirdparty/apache-log4cxx-0.10.0
CXX="g++ -m32" CC="gcc -m32" ./configure --with-apr=../apr-1.4.6/ --with-apr-util=../apr-util-1.5.2/

successful, but when I ran

make

to install the Log4cxx, I got the error:

../../../src/main/include/log4cxx/helpers/simpledateformat.h:56:73: error: 
      reference to 'locale' is ambiguous
  ...SimpleDateFormat(const LogString& pattern, const std::locale* locale);
                                                           ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__locale:55:24: note: 
      candidate found by name lookup is 'std::__1::locale'
class _LIBCPP_TYPE_VIS locale
                       ^
../../../src/main/include/log4cxx/helpers/simpledateformat.h:32:23: note: 
      candidate found by name lookup is 'std::locale'
namespace std { class locale; }
                      ^
../../../src/main/include/log4cxx/helpers/simpledateformat.h:82:89: error: 
      reference to 'locale' is ambiguous
  ...addToken(const logchar spec, const int repeat, const std::locale* locale...
                                                               ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__locale:55:24: note: 
      candidate found by name lookup is 'std::__1::locale'
class _LIBCPP_TYPE_VIS locale
                       ^
../../../src/main/include/log4cxx/helpers/simpledateformat.h:32:23: note: 
      candidate found by name lookup is 'std::locale'
namespace std { class locale; }
                      ^
../../../src/main/include/log4cxx/helpers/simpledateformat.h:83:78: error: 
      reference to 'locale' is ambiguous
  ...static void parsePattern(const LogString& spec, const std::locale* local...
                                                                ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__locale:55:24: note: 
      candidate found by name lookup is 'std::__1::locale'
class _LIBCPP_TYPE_VIS locale
                       ^
../../../src/main/include/log4cxx/helpers/simpledateformat.h:32:23: note: 
      candidate found by name lookup is 'std::locale'
namespace std { class locale; }
                      ^
3 errors generated.
make[3]: *** [class.lo] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1

Does anyone know what I can do to get it working? Thanks!

baf
  • 4,531
  • 1
  • 21
  • 24
shanqiubin
  • 41
  • 2
  • not sure if that helps but you could have a look at brew and install log4cxx from there. http://brew.sh/ – aronadaal May 19 '15 at 06:24
  • 1
    Or, if you prefer to build manually, apply patch according to the [brew formula](https://github.com/Homebrew/homebrew/blob/56b57d583e874e6dfe7a417d329a147e4d4b064f/Library/Formula/log4cxx.rb). – baf May 19 '15 at 08:08
  • @baf Thank you so much! I modified the souce code as the [brew log4cxx.rb](https://github.com/Homebrew/homebrew/blob/56b57d583e874e6dfe7a417d329a147e4d4b064f/Library/Formula/log4cxx.rb) listed, it worked! – shanqiubin May 20 '15 at 08:37

1 Answers1

1

comment the locale class definition in simpledateformat.h and add #include < locale > in the same file

#include  < locale >

//namespace std { class locale; }
zhuomingzhe
  • 116
  • 3