我已经尝试了书中的所有内容以及我能找到的关于如何执行此操作的所有内容,并且重新安装、重新配置和重建了好几次都无济于事。这就是我所拥有的。我在我的 Ubuntu VM 上制作了 FFMPEG 并编写了以下代码:
#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”
谁能想到我没有做或忽略的事情?非常感谢。
最佳答案
我发布了一个解决方案 here
但不要忘记,如果您使用 C++,您应该以这种方式包含 ffmpeg header :
extern "C"{
#include<libavformat/avformat.h>
#include<libavcodec/avcodec.h>
}
关于c++ - 如何将 Ubuntu 11 中的 Eclipse Indigo 链接到 C++ 的 FFMPEG 8,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9088990/