如何编译静态库OpenCV的应用 [英] How to compile OpenCV application with static libraries

查看:537
本文介绍了如何编译静态库OpenCV的应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

preface
我写在C小型应用程序,玩弄OpenCV库的视频文件。
我的机器是Ubuntu的10.04,但客户的操作系统是OpenSuse当中12.1
我已经通过使用cmake桂建OpenCV的2.1,并确保所有必需的图书馆是present(如这里所描述的http://www.shiffman.net/2011/01/23/how-to-build-opencv-static-libraries-mac-os-x/)
我有我的建立与cmake的-GUI应用程序太(这里描述 http://opencv.willowgarage.com/维基/ Getting_started

问题即可。
它工作正常,我的电脑上。但是,客户的机器上,我得到错误加载共享库...。当我运行LDD VIDEO_PLAYER,它不能找到libavformat.so.52,libav codec.so.52和libstdc ++。so.6。有没有一种方法,包括这些库的播放器,使一切工作开箱?

Problem. It works fine on my computer. However, on the customer's machine I get "error loading shared libraries...". When I run "ldd video_player", it cannot find libavformat.so.52, libavcodec.so.52 and libstdc++.so.6. Is there a way to include these libraries with the player so that everything works out of the box?

后记。我猜有应该是一个简单的解决方案。然而,具有Java和PHP强大的背景,我在C总的新手,在大限将至相当快。我尝试使用的ffmpeg来完成这个任务,但它给了很多噩梦,所以我只是坚持的OpenCV,使其尽快制定

Epilogue. I'm guessing there is a simple solution for that. However, having a strong background in Java and PHP, I'm a total newbie in C and the deadline is approaching quite fast. I tried to accomplish this task using ffmpeg, but it gave a lot of nightmares, so I just stick to OpenCV to make it work asap.

在此先感谢!

推荐答案

假设这是典型的:

LDFLAGS=-static buildcommand

这篇关于如何编译静态库OpenCV的应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆