编译bazar包
来源:互联网 发布:苹果机下载不了软件 编辑:程序博客网 时间:2024/05/21 05:23
这两天在ubuntu下编译bazar包,按照官方给出的安装指南,我首先安装了相应的依赖库(这里省略)。然后,运行 ./configure 。配置生成makefile文件。 再make编译。出现如下的错误信息:
从错误信息可以看出:我们使用了一个库变量,但找不到该变量对应的库链接(动态链接库libopencv_imgproc.so)。但是,令人不解的是:编译命令 g++ -g -o2 -o filedetect ........中明明已经将libopencv_imgproc.so添加了,为什么还会报添加libopencv_imgproc.so到编译命令这样的错误呢?
在强大的google下搜索: 'cvSmooth' is defined in DSO /usr/local/lib/libopencv_imgproc.so so try adding it to the linker command line 关键字。有幸发现一个帖子(https://lists.fedoraproject.org/pipermail/devel/2010-March/133601.html):
他所述的错误和我遇到的是一个意思。进入链接https://fedoraproject.org/wiki/UnderstandingDSOLinkChange,里面对这种错误作出的解释。The big difference is that with the proposed change in place, ld will no longer skip linking needed libraries by default. The current default behaviour will lead ld to skip linking with a library if it is listed as a needed by another library that the program uses. In abstract terms, if libA is needed by libB and your program requires both libA and libB, your program may only link to libB. Then if another version of libB comes out that does not list libA as a needed library, then a recompilation will mysteriously break.白高兴一场,他这里是没有对libA进行引用,导致出错。而我,引用了,还出错(尼玛。。。)。
查看makefile文件:
该有的动态库都有了啊!(这与编译命令一致)。无奈之下,我将/usr/local/lib/libopencv_imgproc.so重复一次,加在最后,编译通过了!!!果断将makefile文件改成:
即,将后面生成的链接库加到opencv库前面。什么意思呢,举个例子:libB要用到libA,即libB依赖libA,编译时,我们需要将被依赖项放到最后。这个在写cmakelists的链接库时遇到过,需要注意一下。
最后,对所有samples里面的makefile文件改掉,再make,编译通过。注意:不要再去运行./configure了,不然你白改了。
- 编译bazar包
- OBS编译源码包
- 编译binutil包
- 编译java包
- 编译系统包Settings
- java编译挨包
- 编译deb包过程
- 编译包-库
- rtabmap ros包编译
- mvn 编译jar包
- JAAVA 带包编译
- java包编译问题
- 编译 framework.jar包
- hadoop 编译native包
- 源码编译RPM包
- openwrt编译 IPK包
- 源码包编译安装
- javac编译包及包引用文件
- Java项目经验
- CListCtrl 设置选中状态
- 【linux】 linux gpio操作
- css内联对象和块对象 (
- 高性能计算中并行的概念理解
- 编译bazar包
- 解决CentOS 7.1上LNMP环境运行Laravel报 404 File not found . 错误。
- C++四种强制类型转换的总结
- C++学习笔记(十六):对vector进行更多的操作——泛型算法
- java中的clone()方法的研究---(2)浅克隆和深克隆
- 使用代码为textview设置drawableLeft
- VMware虚拟机中安装centos7.0图解过程
- DrawerLayout侧滑菜单按钮与返回按钮切换
- epoll网络编程实例