我正在尝试设置一个环境来构建 android 并在模拟器上运行它。我最近接触了 AOSP,目前正在阅读一些有关它的书籍。想自己弄乱它,我收到以下错误:
external/libcxx/include/cmath:1345:9: error: no member named 'llrint' in the global namespace; did you mean 'lrint'?
external/libcxx/include/cmath:1348:91: error: use of undeclared identifier 'llrintf'
external/libcxx/include/cmath:1349:91: error: use of undeclared identifier 'llrintl'
external/libcxx/include/cmath:1358:9: error: no member named 'llround' in the global namespace; did you mean 'lround'?
12 errors generated.
make: *** [out/host/darwin-x86/obj/STATIC_LIBRARIES/libc++_static_intermediates/src/hash.o] Error 1
make: *** Waiting for unfinished jobs....
12 errors generated.
make: *** [out/host/darwin-x86/obj/STATIC_LIBRARIES/libc++_static_intermediates/src/debug.o] Error 1
12 errors generated.
make: *** [out/host/darwin-x86/obj/STATIC_LIBRARIES/libc++_static_intermediates/src/random.o] Error 1
12 errors generated.
make: *** [out/host/darwin-x86/obj/STATIC_LIBRARIES/libc++_static_intermediates/src/algorithm.o] Error 1
总共有 12 个错误,中间有文字,但我没有全部复制,因为它们完全相同。 (所有这些都是:错误没有名为“{double L}[SOMETHING]”的成员;你是说:{single L}[SOMETHING])
这是运行的结果:1: source build/envsetup.sh 2: lunch 3: sudo make -j4
我正在使用 El Capitan 并已关注 the official instructions .我遇到的唯一问题是 XCode 没有创建一个包含正确 SDK 的/developer/SDKs 文件夹,所以我从 Github 手动下载 SDK 并将其放入 de SDKs 文件夹(我创建的)。这可能是问题所在吗?
我尝试构建的代码是未修改的 android 6.0.1_r1。我尝试再次运行 repo-init 和 repo sync(可能修复代码)但没有效果。
我知道这个问题很难问,但我不知道如何解决这个问题。提前致谢。
最佳答案
你可以尝试使用 MacOSX10.11.sdk 作为你的 MacOSX-SDK
您可以从 GitHub 下载 MacOSX10.11.sdk:https://github.com/phracker/MacOSX-SDKs
将 MacOSX10.11.sdk 复制到特定路径(例如 ~/lib)并创建到/Applications/XCode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs 的软链接(soft link)
$ ln -s ~/lib/MacOSX10.11.sdk/Applications/XCode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk
(我也把MacOSX10.11.sdk复制到/Developer/SDKs/)
并修改int android源码文件:build/core/combo/mac_version.mk
mac_sdk_versions_supported := 10.9 10.10 10.11
完成! 尝试重新编译源代码!
操作系统:macOS Sierra 10.12
安卓源码:android6.0.1_r1C
XCode:版本 8.2.1
JDK:java版本“1.8.0_101”
关于android - 使用 -make 构建 AOSP 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41427869/