由于未定义的引用,AOSP构建失败
AOSP building fails due to undefined references
我已经下载了Android 2.3.6源代码并成功构建了它。然后,我在外部文件夹中添加了一个c++库,并试图构建它,但是,当我这样做时,我收到了以下错误:
prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/../lib/gcc/arm-eabi/4.4.3/../../../../arm-eabi/bin/ld: path/to/myfile.cpp:26: error: undefined reference to '__cxa_end_cleanup'
prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/../lib/gcc/arm-eabi/4.4.3/../../../../arm-eabi/bin/ld: : error: undefined reference to '__gxx_personality_v0'
in function path/to/myfile.cpp:26: error: undefined reference to 'operator delete(void*)'
我在Android中添加了这一行。可文件:LOCAL_CXX =路径//g++编译器为了使用g++编译器但它仍然使用……/arm-eabi/bin/ld链接到其他库,我如何强制使用g++作为链接器?
你需要编译&链接带有g++
而非gcc
的c++代码
有相同类型的错误,以及'out/xxx/yyy.o: file is empty'
。对我来说,原因是VM在构建过程中崩溃,留下一些文件损坏(不需要做repo sync
,损坏的文件是二进制文件)。
我删除了包含有问题文件的目录,重新启动构建过程,错误消失了。
相关文章:
- C++为构建时间获取QDateTime的可靠方法
- 无法在 CLion 中构建 C++ 项目
- 函数向量_指针有不同的原型,我可以构建一个吗
- 如何使用ndk-build.cmd构建Android.so文件
- libssh 的函数在构建 libssh 时无法在 Qt 和 cmake 错误中找到
- 使用cmake从源代码构建MySQL连接器/C++失败(与以前的声明冲突)
- VSCode-有一个红色下划线,但程序构建和运行正确,并且出现配音错误
- 构建可组合有向图(扫描仪生成器的汤普森构造算法)
- 无法使用Qt Creator在Windows中构建yaml-cpp
- 构建一个由C和C++文件组成的库
- llvm构建器向基本块添加终止符
- FLTK 2.0构建和演示,适用于VS2019的2011年左右的代码库
- 如何跨平台将二进制资源构建到程序中?
- 将 OpenCV 与 CMAKE 中的项目一起构建为第三方库的正确方法
- 如何解决 Ninja c++ 构建和执行问题
- 使用 cmake 的 LLVM 构建在 tsan_libdispatch_mac.cc 期间失败; "Error: conflicting types for ..."
- CMake WxWidgets项目成功地在Linux上构建,但没有在Windows上构建
- 更改命令行 qt5 源代码构建配置的正确/快速方法
- 用CMake构建C++协议
- 由于未定义的引用,AOSP构建失败