解决C++编译时的产生的skipping incompatible xxx 错误

问题

我在编译项目时,产生了一个 /usr/bin/ld: skipping incompatible ../../xxx/ when searching for -lxxx 的编译错误,如下图所示:
在这里插入图片描述

解决方法

由图中的错误可知,在编译时,是能够在我们指定目录下的 *.so 动态库的,但是当使用 -lxxx 方式搜索时,搜索到的动态库是不满足编译条件的。通过查阅网上的资料和我们自身产品的推测,我们怀疑是因为cpu架构不同,而导致的,即我电脑是属于x86的,而我拿到的项目是在arm架构平台上的。

使用 lscpu 查看本机cpu架构。
在这里插入图片描述

使用 readelf 命令查看 ELF 文件的信息,如下图所示,果然如猜测所示,我拿到的程序是基于arm架构的。
在这里插入图片描述

最后换成基于x86架构的,编译通过。。。

参考链接

http://www.aiothome.net/read.php?tid=17801
https://stackoverflow.com/questions/14990222/skipping-incompatible-cannot-find

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-07-10 01:38:02       70 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-07-10 01:38:02       74 阅读
  3. 在Django里面运行非项目文件

    2024-07-10 01:38:02       62 阅读
  4. Python语言-面向对象

    2024-07-10 01:38:02       72 阅读

热门阅读

  1. 部署最新版本elasticsearch 8.14.1和 kibana 8.14.1

    2024-07-10 01:38:02       24 阅读
  2. 玩转springboot之springboot使用外置tomcat进行运行

    2024-07-10 01:38:02       22 阅读
  3. 从GPT-1到GPT-3 预训练语言模型的演进与突破

    2024-07-10 01:38:02       26 阅读
  4. k8s常用组件之pod

    2024-07-10 01:38:02       25 阅读
  5. 【PYG】pytorch中size和shape有什么不同

    2024-07-10 01:38:02       25 阅读
  6. linux指令学习

    2024-07-10 01:38:02       25 阅读
  7. 钉钉消息异常通知

    2024-07-10 01:38:02       21 阅读
  8. python 学习

    2024-07-10 01:38:02       22 阅读
  9. 【Unix/Linux】Unix/Linux如何查看系统版本

    2024-07-10 01:38:02       21 阅读
  10. 【Unix/Linux】$bash-3.2是什么

    2024-07-10 01:38:02       23 阅读
  11. Win11系统vscode配置C语言环境

    2024-07-10 01:38:02       24 阅读
  12. Mojo有哪些优势和劣势

    2024-07-10 01:38:02       20 阅读
  13. 论文阅读:Large Language Models for Education: A Survey

    2024-07-10 01:38:02       26 阅读
  14. ARM汇编的基础语法

    2024-07-10 01:38:02       28 阅读
  15. postman

    postman

    2024-07-10 01:38:02      20 阅读