Linux上,Eclipse的C ++,怎样的ffmpeg库连接到你的项目? [英] Linux, Eclipse C++, how to connect ffmpeg libs to your project?

查看:393
本文介绍了Linux上,Eclipse的C ++,怎样的ffmpeg库连接到你的项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,我下载的FFmpeg从SVN。编译并安装到系统中。在/ usr /地方它创造./lib和./include。一个用包括一在的* .a文件的形式库。

So I downloaded FFmpeg from svn. Compiled and installed into system. in /usr/local it created ./lib and ./include. one with includes and one with libs in form of *.a files.

我下载的是Eclipse赫利俄斯的C ​​++和创造了新的简单的项目。我包括ffmpeg的头在我的C ++文件。在设置中的C / C ++编译项目属性我宣布的ffmpeg库(库搜索路径被宣布)

I downloaded eclipse Helios for C++ and created new simple project. I included ffmpeg headers into my C++ file. in project properties in C/C++Build in settings I declared ffmpeg libs (Library search path was declared)

我写了一些简单的code,从头调用函数。

I wrote some simple code that calls functions from headers.

但我用的所有的ffmpeg的功能它给了我日食没有看到的ffmpeg错误。

But for all ffmpeg functions I used it gave me errors of eclipse not seeing ffmpeg.

所以我想 - 如何ffmpeg的库连接到我的项目(​​或可有什么办法编译ffmpeg的不进。一个,它会用。所以工作)

So I wonder - how to connect ffmpeg libs to my project (or may be there is any way to compile ffmpeg not into .a and it would work with .so)?

推荐答案

我有同样的问题在我的的Ubuntu 12.04 并通过我以这种方式编写的ffmpeg和X264固定它:
我删除的ffmpeg和X264的文件夹,然后键入这个终端:

I had the same problem on my ubuntu 12.04 and I fixed it by compiling ffmpeg and x264 in this way: I removed the folders of ffmpeg and x264 and then typed this in the terminal:

sudo apt-get remove ffmpeg x264
sudo apt-get autoremove

然后

sudo apt-get update
sudo apt-get upgrade

然后

sudo apt-get install make automake g++ bzip2 python unzip patch subversion ruby build-essential git-core checkinstall yasm texi2html libfaac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libsdl1.2-dev libtheora-dev libvdpau-dev libvorbis-dev libvpx-dev libx11-dev libxfixes-dev libxvidcore-dev zlib1g-dev

安装X264

sudo git clone git://git.videolan.org/x264.git
cd x264
sudo ./configure --enable-shared --prefix=/usr/local
sudo make
sudo make install
cd ..

安装libvpx

installing libvpx

sudo wget http://webm.googlecode.com/files/libvpx-v0.9.7-p1.tar.bz2
sudo tar xvjf libvpx-v0.9.7-p1.tar.bz2
cd libvpx-v0.9.7-p1
sudo ./configure --enable-shared --prefix=/usr/local
sudo make
sudo make install
cd ..

检查/etc/ld.so.conf中包含的行 / usr / lib目录的/ usr /本地/ lib目录。如果没有则添加它们,并保存

check if /etc/ld.so.conf contains the lines /usr/lib and /usr/local/lib. if not then add them and save it

然后运行

sudo ldconfig

安装的ffmpeg

installing ffmpeg

sudo wget http://ffmpeg.org/releases/ffmpeg-0.8.10.tar.bz2
sudo tar xvjf ffmpeg-0.8.10.tar.bz2
cd ffmpeg-0.8.10
./configure --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --enable-shared --prefix=/usr/local
sudo make
sudo make install
cd ..
sudo ldconfig

在你的项目,你应该包括这样的标题:

in your project you should include the headers in this way:

#include<libavformat/avformat.h>
#include<libavcodec/avcodec.h>

在Eclipse中你应该添加FFmpeg的库到您的项目:通过转到项目 - >属性 - > C / C ++ avutil,avformat,AV codeC,M,Z ... - >建设 - >设置 - > GCC C ++ - >连接器 - >库

In eclipse you should add the ffmpeg libraries to your project: avutil, avformat, avcodec, m, z ... by going to project->properties->C/C++->Build->Settings->GCC C++-> Linker->Libraries

我希望这对你的作品

这篇关于Linux上,Eclipse的C ++,怎样的ffmpeg库连接到你的项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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