小编Cod*_*ody的帖子

在构建关于ffmpeg的演示时,会发生:对`av_register_all'的未定义引用

这个问题困扰了我好几天.

在编译并安装ffmpeg之后,我尝试使用它构建一个演示,但它总是失败.

该演示是:

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

int main(int argc,char *argv[]) {
    av_register_all();
    return 1;
}
Run Code Online (Sandbox Code Playgroud)

gcc main.c -o main.o,出现错误:undefined reference to 'av_register_all'

使用:构建,gcc main.c -o main.o -lm -ld -lz -lavcodec -lavformat -lavutil发生另一个错误:/usr/bin/ld: cannot find -ld

我该如何解决这个问题?

ffmpeg

6
推荐指数
2
解决办法
5851
查看次数

标签 统计

ffmpeg ×1