c++ - 如何在 Windows XP 上正确安装 ffmpeg?

我正在处理涉及 FFmpeg 库的 Windows 上的 C++ 项目。
问题是我不能在我的项目中包含 ffmpeg 库。我什至无法运行任何 ffmpeg 教程或示例。我总是收到如下错误:

tutorial01.c:22:28: ffmpeg/avcodec.h: No such file or directory
tutorial01.c:23:29: ffmpeg/avformat.h: No such file or directory

还有很多错误,例如:
tutorial01.c:33: error: `iFrame' undeclared (first use in this function)

我找到了带有以下说明的教程:
//gcc -o tutorial01 tutorial01.c -lavformat -lavcodec -lz
//to build (assuming libavformat and libavcodec are correctly installed
//your system).

经过进一步搜索,我发现我应该从这里获得一个静态构建库版本:
http://ffmpeg.zeranoe.com/builds/
然后我按照以下说明安装了这个库:
  • 从 arrozcru 自动构建页面
  • 获取最新版本
  • 解压文件夹到C:/Program Files/ffmpeg
  • 将 C:/Program Files/ffmpeg/bin 添加到系统的 PATH 环境变量

  • 但是我仍然有同类的编译错误。
    因此,似乎安装不正确。

    我应该怎么做才能将 ffmpeg 库连接到我在 Windows 上的项目?

    最佳答案

    所以总结答案,你需要将ffmpeg的include和lib目录添加到gcc的目录路径中。

    https://stackoverflow.com/questions/10026603/

    相关文章:

    javascript - 编译CoffeeScript

    c++ - 使用Visual Studio Express和SDL2在Windows中破坏了SDL_

    c# - 添加方法导致编译错误 C# ASP

    compiler-errors - 使用ROSE编译器框架的g++编译器错误

    android - Debian Sid 上的 Android 内核总是出错

    android - 无法在 android opencv 2.3 中导入 ml.h

    android - 在Eclipse上调试Android应用时出错

    c++ - 将模板函数传递给另一个模板函数

    ios - ZXing Xcode 4.2 iOS编译错误

    visual-studio-2010 - Visual Studio 2010 C++发行模式问题