这个问题困扰了我好几天.
在编译并安装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
我该如何解决这个问题?
ruw*_*800 11
在extern"C"块中放置包含可能有效.
extern "C"{
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libswscale/swscale.h>
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5851 次 |
| 最近记录: |