c++ - 如何将 Ubuntu 11 中的 Eclipse Indigo 链接到 C++ 的 FFMPEG 8

标签 c++ eclipse ffmpeg linker-errors

我已经尝试了书中的所有内容以及我能找到的关于如何执行此操作的所有内容,并且重新安装、重新配置和重建了好几次都无济于事。这就是我所拥有的。我在我的 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/

相关文章:

c++ - 从子类 : gcc vs msvc 访问 protected 成员

c++ - psapi.dll 进程状态api

c++ - 为什么我们得到构建错误 "error C2065: ' ostringstream' : undeclared identifier"& How to fix this?

c# - C#中的实时视频流

c++ - 为什么这适用于 Visual C++,但不适用于 gcc?

java - RCP 导出向导删除不必要的项目

java - 在 SWT 树中查找特定项目

android - 如何在 Eclipse 中添加字符串资源?

c++ - ffmpeg:如何将 h264 原始数据保存为 mp4 文件

ffmpeg - 通过ffmpeg中的过滤器映射元数据流