android - 错误 : declaration conflicts with target of using declaration already in scope

标签 android macos android-source android-build

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

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

关于android - 错误 : declaration conflicts with target of using declaration already in scope,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47060910/

相关文章:

macos - 系统是否支持带有红色关闭按钮的 HUD 样式窗口?

使用 Xcode UI 测试的 Swift 异步事件处理

android - <remove-project> 如何在 repo list 中工作?

android - Git repo 同步 - 连接丢失

android - 单击 View 寻呼机第二个 fragment 中的按钮时返回 View 寻呼机的第一个 fragment

Android 从 Intent 中捕获数据

android - 无法通过 adb 在 Ubuntu 9.10 上访问 Motorola Milestone(HTC Magic 工作得很好)

java - 如何在横向模式下检测方向

objective-c - 将带有 URL 参数的 HTML 文件加载到 Cocoa(不是 iPhone)WebView 中

android - 在aosp上设置文件权限