这个问题困扰了我好几天.
在编译并安装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 ×1