我是 android 构建系统的新手,在 MAC OS 中构建时出现以下错误。请帮助我成功构建。
In file included from external/libcxx/src/any.cpp:10:
In file included from external/libcxx/include/experimental/any:84:
external/libcxx/include/cstdlib:167:44: error: declaration conflicts with target of using declaration already in scope
inline _LIBCPP_INLINE_VISIBILITY long abs( long __x) _NOEXCEPT {return labs(__x);}
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/stdlib.h:115:44: note: target of using declaration
inline _LIBCPP_INLINE_VISIBILITY long abs( long __x) _NOEXCEPT
{return labs(__x);}
^
external/libcxx/include/cstdlib:135:9: note: using declaration
using ::abs;
^
external/libcxx/include/cstdlib:169:44: error: declaration conflicts with target of using declaration already in scope
inline _LIBCPP_INLINE_VISIBILITY long long abs(long long __x) _NOEXCEPT {return llabs(__x);}
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/stdlib.h:117:44: note: target of using declaration
inline _LIBCPP_INLINE_VISIBILITY long long abs(long long __x) _NOEXCEPT {return llabs(__x);}
^
external/libcxx/include/cstdlib:135:9: note: using declaration
using ::abs;
^
external/libcxx/include/cstdlib:172:42: error: declaration conflicts with target of using declaration already in scope
inline _LIBCPP_INLINE_VISIBILITY ldiv_t div( long __x, long __y) _NOEXCEPT {return ldiv(__x, __y);}
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/stdlib.h:120:42: note: target of using declaration
inline _LIBCPP_INLINE_VISIBILITY ldiv_t div( long __x, long __y) _NOEXCEPT {return ldiv(__x, __y);}
^
external/libcxx/include/cstdlib:143:9: note: using declaration
using ::div;
^
external/libcxx/include/cstdlib:174:42: error: declaration conflicts with target of using declaration already in scope
inline _LIBCPP_INLINE_VISIBILITY lldiv_t div(long long __x, long long __y) _NOEXCEPT {return lldiv(__x, __y);}
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/stdlib.h:122:42: note: target of using declaration
inline _LIBCPP_INLINE_VISIBILITY lldiv_t div(long long __x, long long
__y) _NOEXCEPT {return lldiv(__x, __y);}
^
external/libcxx/include/cstdlib:143:9: note: using declaration
using ::div;
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
ninja: build stopped: subcommand failed.
make: *** [ninja_wrapper] Error 1
最佳答案
我刚刚遇到了同样的问题。 Xcode 9 的 llvm 编译器似乎有一个错误:https://forums.developer.apple.com/thread/87814
我通过以下方式解决了这个问题:
- 删除 xcode 9:https://macpaw.com/how-to/uninstall-xcode-on-macos
- 从 https://developer.apple.com/download/more/ 下载并安装 xcode 8.3.3
关于android - 错误 : declaration conflicts with target of using declaration already in scope,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47060910/