我正在按照本教程使用 Microsoft 的编译器静态构建 FFmpeg(不需要 DLL):http://cristobaldobranco.github.io/blog/2015/01/20/compiling-ffmpeg-with-windows-tools/
然而,我在尝试编译时遇到了麻烦:
#pragma comment (lib, "libavformat.a")
#define __STDC_CONSTANT_MACROS
extern "C" {
#include <libavformat/avformat.h>
}
int main() {
av_register_all();
return 0;
}
它似乎能够找到头文件和库文件,但我收到关于 opus 的奇怪错误:
这是我的 MSYS 命令:
cd C:/Libs/ffmpeg
./configure --toolchain=msvc --arch=x86 --prefix=build/ --disable-network
make
make install
如何消除这些错误?
最佳答案
Opus 使用了一些重采样功能,因此在链接 libavcodec.a(在 libavformat.a 中使用)时需要链接 libswresample.a。
关于c++ - FFmpeg编译opus错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31909032/