在64位Ubuntu 12.04上运行aapt:加载共享库时出错:libc++.所以:没有这样的文件或目录
Running aapt on 64-bit Ubuntu 12.04: error while loading shared libraries: libc++.so: No such file or directory
我下载了Android开源项目,并使用以下说明在Linux(Ubuntu 12.04 64位)上构建了它:
http://source.android.com/source/building.html
我可以毫无问题地构建它。构建完成后,我对构建工具很感兴趣,尤其是aapt。当我运行它时,我看到这个:
awt@aosp-build:/aosp/out/host/linux-x86/sdk/sdk/android-sdk_eng.awt_linux-x86/build-tools/android-5.0.50.50.50.50$ ./aapt
./aapt: error while loading shared libraries: libc++.so: cannot open shared object file: No such file or directory
所以,这很奇怪。特别是考虑到libc++.so就在同一目录中:
awt@aosp-build:/aosp/out/host/linux-x86/sdk/sdk/android-sdk_eng.awt_linux-x86/build-tools/android-5.0.50.50.50.50$ ls -l
-rwxrwxr-x 1 awt awt 1118633 Feb 4 19:42 aapt
-rwxrwxr-x 1 awt awt 1261036 Feb 4 19:42 libc++.so
$ file aapt
aapt: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, not stripped
$ file libc++.so
libc++.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, not stripped
我已经构建并使用了旧的Android版本的构建工具,上一个是4.3。为了让它运行,我需要:
$ sudo apt-get install ia32-libs
这让我能够运行它,它起到了作用。有了安卓的最新版本,这已经不够了。我仍然得到libc++.so: cannot open shared object file message
。
在out目录中还有其他中间版本的aapt。例如,这个:
$file/aosp/out/host/linux-x86/bin/aaptaapt:ELF 32位LSB共享对象,Intel 80386,版本1(SYSV),动态链接(使用共享库),适用于GNU/Linux 2.6.24,未剥离$ls-l/aosp/out/host/linux-x86/bin/aapt-rwxrwxr-x 1 awt awt 6978260 2月4日17:50 aapt
这个跑了。它还没有被剥离,所以共享的libs仍然嵌入其中。如果我剥离它:
$ strip -s aapt
$ ./aapt
./aapt: error while loading shared libraries: libc++.so: cannot open shared object file: No such file or directory
然后我们又回到了起点。我可以做些什么来使剥离版本按以前的方式运行?
这是一个老问题,但最近的一次投票提醒我,我确实有一个解决方案。
答案是将libc++.so的位置附加到当前LD_LIBRARY_PATH:
$ export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/path/to/libc++.so
$ ./aapt -version
Android Asset Packaging Tool
Usage:
aapt l[ist] [-v] [-a] file.{zip,jar,apk}
List contents of Zip-compatible archive.
相关文章:
- 带有 -stdlib=libc++ 的 clang++ 9.0.1 找不到<optional>
- C++17 - 使用自定义分配器的节点提取/重新插入 - 适用于 clang++/libc++,但不适用于 libstd
- 安装 libc++ 时出现问题
- 在这个函数中是有缺陷的,因为取消引用 null 是无效的,所以我想更改代码
- 尝试从头开始实现Leetcode的FizzBuzz多线程问题。收到"libc++abi.dylib: terminating"错误
- 所以我正在为我的学校作业练习继承,但我无法正确实施标题保护
- Eclipse CDT clang 工具链 - 无法从链接器选项中删除 stdlibc++,但可以添加 libc++,E
- 如何创建一个共享对象与另一个.所以在Cmake
- 野牛/flex:计算器将双精度值解释为整数,所以我添加了 YYSTYPE 双精度 #define 但我有多个编译错误
- C++不重载时间函数,所以我们不需要写 NULL 有什么原因吗?
- 我可以在 ndk 中使用带有 libc++ 的实验性文件系统吗?
- E/libc++abi:终止于类型为google::protobuf::FatalException的未捕获异常
- libc++abi未定义符号:_ZTVN10__cxxabif120__si-class_type_infoE
- 加快一个长python代码的速度,因为只有一个块,所以速度很慢
- 在继承自 std::variant 的类上使用 std::visit——libstdc++ 与 libc++
- 在libc++和libstdc++之间的std::map上使用std::find时的实现差异
- 在clang的travis上使用不同的libc++版本
- MRB_THROW会导致libc++abi.dylib中的错误
- libc++:为什么流关闭后仍然很好
- 在64位Ubuntu 12.04上运行aapt:加载共享库时出错:libc++.所以:没有这样的文件或目录