在用AndroidStudio开发APP时,因重新拉取git仓库代码,导致以下错误:

[164/164] Linking CXX shared library ..\..\..\..\build\intermediates\cmake\debug\obj\arm64-v8a\libailiving.so
FAILED: cmd.exe /C "cd . && C:\Users\LENOVO\AppData\Local\Android\Sdk\ndk\22.1.7171670\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe  --target=aarch64-none-linux-android24 --gcc-toolchain=C:/Users/LENOVO/AppData/Local/Android/Sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/windows-x86_64 --sysroot=C:/Users/LENOVO/AppData/Local/Android/Sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/windows-x86_64/sysroot -fPIC -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security  -O3 -fexceptions -fsigned-char -frtti -std=c++14 -Wformat -fuse-ld=lld -std=gnu++11 -O2 -DNDEBUG  -s -O3 -Wall  -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libgcc_real.a -Wl,--exclude-libs,libatomic.a -static-libstdc++ -Wl,--build-id=sha1 -Wl,--no-rosegment -Wl,--fatal-warnings -Wl,--no-undefined -Qunused-arguments -shared -Wl,   .............. ../../../../src/main/jniLibs/arm64-v8a/libvulkan.so -llog -latomic -lm && cd ."
ld.lld: error: found local symbol '_edata' in global part of symbol table in file ../../../../src/main/jniLibs/arm64-v8a/libopencv_java3.so
ld.lld: error: found local symbol '__end__' in global part of symbol table in file ../../../../src/main/jniLibs/arm64-v8a/libopencv_java3.so
ld.lld: error: found local symbol '__bss_end__' in global part of symbol table in file ../../../../src/main/jniLibs/arm64-v8a/libopencv_java3.so
ld.lld: error: found local symbol '_bss_end__' in global part of symbol table in file ../../../../src/main/jniLibs/arm64-v8a/libopencv_java3.so
ld.lld: error: found local symbol '__bss_start__' in global part of symbol table in file ../../../../src/main/jniLibs/arm64-v8a/libopencv_java3.so
ld.lld: error: found local symbol '_end' in global part of symbol table in file ../../../../src/main/jniLibs/arm64-v8a/libopencv_java3.so
ld.lld: error: found local symbol '__bss_start' in global part of symbol table in file ../../../../src/main/jniLibs/arm64-v8a/libopencv_java3.so
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.

> Task :app:externalNativeBuildDebug FAILED
ld.lld: error: found local symbol '__bss_start' in global part of symbol table in file ../../../../src/main/jniLibs/arm64-v8a/libopencv_java3.so

上面错误明显是链接时  __bss_start 等重复了。网上有说在CMake加  -fuse-ld=gold 或者 -fuse-ld=lld 编译项的。(参考 "local symbol '__bss_start' in global part of symbol table" only in Android NDK aarch64 build - Stack Overflow)

其实都没有用,归根结底还是NDK版本不同导致的,因为libopencv_java3.so库文件是在官网下载的,不知道但是是用什么方式编译生成的。想想之前的代码一点问题都没有,为什么重新拉取代码后就出问题呢?应该还是编译环境不同导致的。

我这里用的是NDK版本是22.1.7171670,找回之前的项目目录查看NDK版本发现是21.1.6352462。立刻更换NDK版本,就能编译通过了。

看来,用第三方编译好了的库文件还有版本匹配的风险。

遇到 ld.lld: error: found local symbol ‘__bss_start‘ in global part of symbol table in file 错误相关推荐

  1. ld.lld: error: undefined symbol: android::CallStack::CallStack()

    在Android frameworks nuplayer中堆栈的时候, 用如下patch,发现编译报错是"ld.lld: error: undefined symbol: android:: ...

  2. STVD ERROR:misplaced local declaration

    STVD ERROR:misplaced local declaration 问题解决: 在使用STVD的时候报如上错误,发现是STVD的编译器COSMIC的编译语法标准和C99的不一样,C99中,函 ...

  3. git pull 问题“error: Your local changes to the following files would be overwritten by merge”

    问题描述: error: Your local changes to the following files would be overwritten by merge 解决办法: 方法1: 如果你想 ...

  4. error: Your local changes to the following files would be overwritten by merge

    用git pull来更新代码的时候,遇到了下面的问题: error: Your local changes to the following files would be overwritten by ...

  5. 解决 error: Your local changes to the following files would be overwritten by merge:XXXX

    前些天发现了一个巨牛的人工智能学习网站,通俗易懂,风趣幽默,忍不住分享一下给大家.点击跳转到教程. idea 上将本地代码推送到 git后 , 报错如下图 error: Your local chan ...

  6. 【部署问题】解决Nginx: [error] open() "/usr/local/Nginx/logs/Nginx.pid“ failed(2:No such file or directory)

    [部署问题]解决Nginx: [error] open() "/usr/local/Nginx/logs/Nginx.pid" failed(2:No such file or direct ...

  7. git代码库pull报错:error: Your local changes to the following files would be overwritten by merge

    前言 编辑器会把没有添加到忽略名单的文件自动add到git的暂存区. 起因 某次build后打了个zip压缩包放在根目录下,被自动add了,但commit时把勾打掉没有提交.第二天来把这个zip包手动 ...

  8. 区分 %d, %ld, %lld, %lf, %f 等

    区分 %d, %ld, %lld, %lf, %f 等 %d:用于 int %ld:用于 long %lld:用于 longlong 输入时: float 输入用 %f double 输入用 %lf ...

  9. ./ffmpeg: error while loading shared libraries: libx264.so.138: cannot open shared object file: No s

    在安装ffmpeg时,执行完 ./configure--enable-libx264 --enable-gpl --disable-yasm --prefix=/usr/local/ffmpeg ma ...

最新文章

  1. opencv 解析yuv_OpenCV Mat格式存储YUV图像
  2. python封装c++接口_使用MetaSIP自动生成SIP封装C++到Python接口
  3. leetcode剑指 Offer 42. 连续子数组的最大和(动态规划)
  4. windows程序消息机制(Winform界面更新有关)
  5. c语言状态机_【C语言】有限状态机FSM
  6. 【MySQL】浅谈一致性读
  7. 利用openmp实现矩阵相乘_MP116:线性代数补习班(4):矩阵的张量积
  8. 洛谷P1238 走迷宫
  9. android+3.1.2+imagebutton监听,android Button ImageButton 差别
  10. Opencl入门Demo
  11. html5中如何修改背景颜色,html5里颜色 关于html5背景颜色的问题
  12. 手机dlna到linux,linux dlna服务器
  13. 转载-中文文案排版指指南
  14. NS3_Tutorial 中文版: 第四章 NS3 概念概述
  15. linux zfs raid,Linux中的ZFS RAID和LUKS加密
  16. 微金所获2015(行业)最具影响力品牌奖
  17. 命令与征服:绝命时刻
  18. 信用百度公司商标信息爬取
  19. 面试表演了手写HashMap,把面试官给秀到了
  20. 前端鼠标移入悬浮框针对页面顶部和底部的定位设置

热门文章

  1. comsol-亥姆霍兹线圈
  2. ps 选区工具的使用
  3. Jenkins常用插件之Publish Over SSH
  4. 今日头条能干掉微信么? | 畅言
  5. 完整的电商网页,技术html,css
  6. 公钥私钥及ssh公钥无密码登录
  7. 在jsp页面上直接打开PDF文件
  8. 无人驾驶--实时定位与地图构建(SLAM)仿真与实战(附源码)
  9. Vue(Vue脚手架)
  10. arch linux界面,ArchLinux图形界面安装