OpenIN2 Linux 编译OpenCV 报错undefined reference to `xxx@xxx‘

简介: OpenIN2 Linux 编译OpenCV 报错undefined reference to `xxx@xxx‘

大概是在链接SimpleViewer的时候

/usr/bin/ld: /home/moresweet/Downloads/OpenNI_2.3.0.81_202110281040_ff72b9bf_release_linux/samples/samples/SimpleViewer/../ThirdParty/OpenCV420/Linux/lib/libopencv_highgui.so: .dynsym local symbol at index 2 (>= sh_info of 2)
/usr/bin/ld: /home/moresweet/Downloads/OpenNI_2.3.0.81_202110281040_ff72b9bf_release_linux/samples/samples/SimpleViewer/../ThirdParty/OpenCV420/Linux/lib/libopencv_highgui.so: .dynsym local symbol at index 3 (>= sh_info of 2)
/usr/bin/ld: /home/moresweet/Downloads/OpenNI_2.3.0.81_202110281040_ff72b9bf_release_linux/samples/samples/SimpleViewer/../ThirdParty/OpenCV420/Linux/lib/libopencv_highgui.so: .dynsym local symbol at index 4 (>= sh_info of 2)
/usr/bin/ld: /home/moresweet/Downloads/OpenNI_2.3.0.81_202110281040_ff72b9bf_release_linux/samples/samples/SimpleViewer/../ThirdParty/OpenCV420/Linux/lib/libopencv_imgcodecs.so: .dynsym local symbol at index 2 (>= sh_info of 2)
/usr/bin/ld: /home/moresweet/Downloads/OpenNI_2.3.0.81_202110281040_ff72b9bf_release_linux/samples/samples/SimpleViewer/../ThirdParty/OpenCV420/Linux/lib/libopencv_imgcodecs.so: .dynsym local symbol at index 3 (>= sh_info of 2)
/usr/bin/ld: /home/moresweet/Downloads/OpenNI_2.3.0.81_202110281040_ff72b9bf_release_linux/samples/samples/SimpleViewer/../ThirdParty/OpenCV420/Linux/lib/libopencv_imgcodecs.so: .dynsym local symbol at index 4 (>= sh_info of 2)

2018122814580746.png

Ubuntu20.04,gcc也为9.x,opencv为4.5.5,故怀疑官方链接的库并不适配我的本地环境

以下是官方自带的链接库

2018122814580746.png

编辑CMakeLists(/home/[YOUR USRENAME]/Downloads/OpenNI_2.3.0.81_202110281040_ff72b9bf_release_linux/samples/samples/SimpleViewer),更改为自己的opencv库所在的目录

2018122814580746.png

重新编译,链接成功

2018122814580746.png

相关文章
|
Ubuntu Linux 编译器
Linux/Ubuntu下使用VS Code配置C/C++项目环境调用OpenCV
通过以上步骤,您已经成功在Ubuntu系统下的VS Code中配置了C/C++项目环境,并能够调用OpenCV库进行开发。请确保每一步都按照您的系统实际情况进行适当调整。
3075 3
|
定位技术
vue-baidu-map 报错 | map is undefined
vue-baidu-map 报错 | map is undefined
294 1
|
定位技术
vue-baidu-map 报错 | BMap is undefined
vue-baidu-map 报错 | BMap is undefined
442 1
|
Ubuntu Linux C语言
【opencv】opencv在windows和linux的应用
【opencv】opencv在windows和linux的应用
|
JavaScript
VUE——filemanager-webpack-plugin报错TypeError: Cannot read property 'isFile' of undefined
VUE——filemanager-webpack-plugin报错TypeError: Cannot read property 'isFile' of undefined
495 0
|
JavaScript 前端开发
报错:Cannot read properties of undefined (reading ‘$message‘)解决方法
以上就是解决"Cannot read properties of undefined (reading ‘$message‘)"错误的几种方法,希望对你有所帮助。
7447 0
|
关系型数据库 MySQL Serverless
函数计算操作报错合集之当遇到“Cannot read properties of undefined(reading 'props')”错误,该怎么处理
在使用函数计算服务(如阿里云函数计算)时,用户可能会遇到多种错误场景。以下是一些常见的操作报错及其可能的原因和解决方法,包括但不限于:1. 函数部署失败、2. 函数执行超时、3. 资源不足错误、4. 权限与访问错误、5. 依赖问题、6. 网络配置错误、7. 触发器配置错误、8. 日志与监控问题。
1834 0
|
SQL 分布式计算 大数据
MaxCompute操作报错合集之执行sql时,出现Cannot read properties of undefined (reading 'start')错误提示,该怎么办
MaxCompute是阿里云提供的大规模离线数据处理服务,用于大数据分析、挖掘和报表生成等场景。在使用MaxCompute进行数据处理时,可能会遇到各种操作报错。以下是一些常见的MaxCompute操作报错及其可能的原因与解决措施的合集。
895 0
|
前端开发 小程序 JavaScript
微信小程序-Unhandled promise rejection TypeError: Cannot read property ‘get‘ of undefined
微信小程序-Unhandled promise rejection TypeError: Cannot read property ‘get‘ of undefined
|
存储 JavaScript 前端开发
成功解决:Cannot read properties of undefined (reading ‘commit‘)
这篇文章提供了解决Vuex中"Cannot read properties of undefined (reading 'commit')"错误的两种方法:检查模板中的数据属性是否存在,以及确保在Vue实例中正确挂载了store对象。
成功解决:Cannot read properties of undefined (reading ‘commit‘)