错误:声明与范围

时间:2017-11-01 17:54:54

标签: android macos android-source android-build

我是android构建系统的新手,我在MAC OS中构建时遇到以下错误。请帮助我建立成功。

在external / libcxx / src / any.cpp:10中包含的文件中: 在external / libcxx / include / experimental / any:84:

中包含的文件中

external / libcxx / include / cstdlib:167:44:错误:声明与已在范围内使用声明的目标冲突 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:注意:使用声明的目标

内联_LIBCPP_INLINE_VISIBILITY长abs(长__x)_NOEXCEPT

{return labs(__ x);}                                            ^

external / libcxx / include / cstdlib:135:9:注意:使用声明

使用:: abs;         ^

external / libcxx / include / cstdlib:169:44:错误:声明与已在范围内使用声明的目标冲突 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:注意:使用声明的目标 inline _LIBCPP_INLINE_VISIBILITY long long abs(long long __x)_NOEXCEPT {return llabs(__ x);}                                            ^ external / libcxx / include / cstdlib:135:9:注意:使用声明 using :: abs;         ^ external / libcxx / include / cstdlib:172:42:error:声明与已在范围内使用声明的目标冲突 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:注意:使用声明的目标 inline _LIBCPP_INLINE_VISIBILITY ldiv_t div(long __x,long __y)_NOEXCEPT {return ldiv(__ x,__ y);}                                          ^ external / libcxx / include / cstdlib:143:9:注意:使用声明 using :: div;         ^ external / libcxx / include / cstdlib:174:42:错误:声明与已在范围内使用声明的目标冲突 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:注意:使用声明的目标

内联_LIBCPP_INLINE_VISIBILITY lldiv_t div(long long __x,long long

__ y)_NOEXCEPT {return lldiv(__ x,__ y);}

                                     ^

external / libcxx / include / cstdlib:143:9:注意:使用声明 using :: div;         ^

致命错误:发出的错误太多,现在停止[-ferror-limit =]

生成了20个错误。

忍者:构建已停止:子命令失败。

make:*** [ninja_wrapper]错误1

2 个答案:

答案 0 :(得分:3)

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

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

答案 1 :(得分:0)

就我而言,我已将其修复并删除并下载了Android NDK。之后,我尝试进行多次构建。由于Mac OS禁止下载其他文件,因此必须在“安全和隐私”中允许它,然后重新开始构建