我正在尝试在Mac OS X Yosemite(Xcode 6.3.1)上构建Log4cxx-0.10.0。
我跑了
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/
成功了,但是当我跑了
make
安装Log4cxx,我收到错误:
../../../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
有谁知道我能做些什么才能让它发挥作用? 谢谢!
答案 0 :(得分:0)
在 simpledateformat.h 中注释语言环境类定义,并在同一文件中添加#include < locale >
#include < locale >
//namespace std { class locale; }