【问题标题】:error: declaration conflicts with target of using declaration already in scope错误:声明与使用声明的目标冲突已经在范围内
【发布时间】:2017-11-01 17:54:53
【问题描述】:

我是 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

【问题讨论】:

    标签: android macos android-source android-build


    【解决方案1】:

    我也遇到了同样的问题。 Xcode 9 的 llvm 编译器中似乎有一个错误:https://forums.developer.apple.com/thread/87814

    我通过以下方式解决了问题:

    【讨论】:

    • 如果我无法安装 Xcode 8.3.3 怎么办?因为我有一个更新的 MacOSX(Big sur) 并且它与 Xcode8.3.3 不兼容
    【解决方案2】:

    在我的情况下,我修复了它,删除并下载了 Android NDK。之后我多次尝试构建。由于 Mac OS 阻止下载一些额外的文件,您必须在“安全和隐私”中允许它并重新开始构建

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-07-23
      • 2012-05-09
      • 1970-01-01
      • 2012-04-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多