2012-02-01 53 views
1

我已经尝试了本书中的所有内容以及所有可以找到的关于如何执行此操作并重新安装并重新配置和重建几次而无济于事的所有内容。这是我的。我做了FFmpeg的在我的Ubuntu VM,并写了下面的代码:如何将Eclipse 11中的Eclipse Indigo链接到FFMPEG 8 for C++

#include "libavcodec/avcodec.h" 
#include "libavformat/avformat.h" 

#include <stdio.h> 
#include <iostream> 

using namespace std; 

int main(int argc, char* argv[]) { 

    avcodec_register_all(); 

    return 0; 
} 

这个错误,并说:

/home/adam/workspace/MP4 Tools/Debug/../testDriver.cpp:19: undefined reference to  `avcodec_register_all()' 
collect2: ld returned 1 exit status 

我已经包括libavcodec.a文件。项目 - >属性 - > GCC C++链接器 - >库 - >添加“avcodec”

任何人都可以想到我没有做或忽略的东西?非常感谢。

回答

1

我张贴的解决方案here

,但不要忘了,如果你使用C++,你应该有这样的ffmpeg标题:

extern "C"{ 
#include<libavformat/avformat.h> 
#include<libavcodec/avcodec.h> 
}