Linux_Qt:-1: error: cannot find xxx/lib: file format not recognized
给QT工程 pro文件添加zmq的项目lib时,编译出现:
:-1: error: cannot find /opt/toolschain/zeroMQ/zeromq_gcc/lib: file format not recognized
原因是qt无法识别lib目录下的部分lib库文件格式
可以使用“ll”或者“ls -al”命令查看文件的指向类型
从图中可以看出libzmq.so.5.0.0是libzmq.so和libzmq.so.5的软连接
所以libzmq.so.5.0.0是非.so文件,所以qt在加载lib目录时会把目录下的所有文件当成lib文件,不会以后缀名。
它是一个描述文件,和la一样,la是libtool生成的描述文件,用于描述告诉GNU的编译器该在不同的平台下使用或生成不同的静态库以及动态库,因为不同的平台,所使用的库格式不同。
所以我们只需要把libzmq.so.5.0.0删除还有libzmq.la,同时pkgconfig是生成的配置目录,也可以删除
这样就可以完美编译通过了。
值得注意的是,如果你的库目录下的库文件是32位的,你的qt程序是64位的那么也是无法通过的也会报这个错误
如果不想删除软连接,可以直接在pro文件里把.so文件路径给出来就可以了:
LIBS += /opt/toolschain/zeroMQ/zeromq_gcc/lib/libzmq.so
lib目录下只包含lib文件,其余的不要包含!
Linux_Qt:-1: error: cannot find xxx/lib: file format not recognized相关推荐
- ❤️ file format not recognized; treating as linker script 【莫名奇妙的bug系列】❤️
目录 一.问题描述 二.出错原因 三.解决方案 一.问题描述 linux环境下,C++编译出现问题,报错: XXX.so:file format not recognized; treating as ...
- /lib//libclntsh.so: file format not recognized; treating as linker script
centos7.7+oracle19.3 建库过程报错:预检查都是通过的 /oracle/product/19.3.0/db_1/lib/libasmperl19.a -Wl,--no-whole-a ...
- 编译报错file format not recognized和collect2: error: ld returned 1 exit status记录
报错啦! 年少无知不懂事,在编译多文件的时候使用了*来编译所有文件 ,于是报了这个错 ld: cannot find res: file format not recognized collect2: ...
- 编译报错file format not recognized; treating as linker script
linux环境下,C++编译出现问题,报错 XXX:file format not recognized; treating as linker script XXX:syntax error 原因是 ...
- win7 vscode mingw c++ 报错 file format not recognized treating as linker script
问题:file format not recognized; treating as linker script 原因:是自己写了其他的头文件和cpp,然后在test.cpp中包含调用,发现自己写的其 ...
- “undefined reference to JNI_GetCreatedJavaVM”和“File format not recognized”错误原因分析...
"undefined reference to JNI_GetCreatedJavaVM"和"File format not recognized"错误原因分析 ...
- libopencv_core.so: file not recognized: File format not recognized
/dependencies/OpenCV348/lib/libopencv_core.so: file not recognized: File format not recognized 解决方法: ...
- ubuntu makefile交叉编译报错:file not recognized: file format not recognized
在linux ubuntu上编译netkit-ftp的时候报错:file not recognized: file format not recognized [root@ubuntu /arnold ...
- C++:错误:File format not recognized
文章目录 错误 原因 错误 源文件后缀要是合法的规则.cpp/cxx/hpp/ g++ a.sh .: file not recognized: File format not recognized ...
最新文章
- mongoDB 入门指南、示例
- 女子质疑无限极产品致女儿心肌损害:将继续维权讨说法
- 组策略脚本的趣味应用
- 2020腾讯校招后台开发
- mysql 创建用户与授权
- myeclipse 删除历史工作空间记录
- PyQt5显示一个空白的窗口
- Shinning - 我所听过最棒的演讲
- 22. Leetcode 237. 删除链表中的节点 (链表-基础操作类-删除链表的节点)
- 美团医美发起“至美行动”,单月拦截六万余条虚假医美评价
- 65. Valid Number
- Linux select TCP并发服务器与客户端编程
- Educational Codeforces Round 90 (Rated for Div. 2)(A, B, C, D, E)
- 517. 超级洗衣机
- hive 如果表不存在则创建_从零开始学习大数据系列(四十七) Hive中数据的加载与导出...
- Resource stopwords not found. Please use the NLTK Downloader to obtain the resource的解决
- Java面试题中的Redis大合集,所有你想找的都在这里!
- 配置 eNSP 连接VMware虚拟机网络
- Hadoop—数据仓库分层介绍
- 工作感悟_of_RS
热门文章
- excel 两组数据交点_让科研人相见恨晚的技巧,用Excel做柱状图、箱型图及数据分析!(转载自ZSCI)...
- python输出杨辉三角啊二维数组_用Python输出一个杨辉三角的例子
- 微信小程序 地图功能的实现 map
- php 操作系统,PHP 处理文件和操作系统
- 一道经典面试题 你是是否理解 if()没有大括号与有大括号区别吗?
- 长沙理工考研2021计算机软件科目,2021考研进行时:速览最新招生信息
- wince 内存释放_【转载】让我生不如死的WINCE内存泄漏
- python中用来抛出异常的关键字是( )_python异常抛出
- 搭建gradle环境
- guid会重复么_饿了么请你考虑一下消费者