我正在尝试使用gcc执行tutorial01.c并且我在同一个文件夹中有gcc和tutorial01.c以及libavcodec和libavformat及其相关文件它给了我这个错误
致命错误:libavcodec/avcodec.h没有这样的文件或目录编译终止
当我gcc -o tutorial01 tutorial01.c -lavformat -lavcodec -lz在ubuntu 12.04中运行 终端时
代码是
#include libavcodec/avcodec.h
#include libavformat/avformat.h
#include stdio.h
void SaveFrame(AVFrame *pFrame, int width, int height, int iFrame)
{
FILE *pFile;
char szFilename[32];
int y;
// Open file
sprintf(szFilename, "frame%d.ppm", iFrame);
pFile=fopen(szFilename, "wb");
if(pFile==NULL)
return;
// Write header
fprintf(pFile, "P6\n%d %d\n255\n", width, height);
// Write pixel data
for(y=0; y<height; y++)
fwrite(pFrame->data[0]+y*pFrame->linesize[0], 1, width*3, pFile);
// Close file
fclose(pFile);
}
int main(int argc, char *argv[])
{
AVFormatContext *pFormatCtx;
int i, …Run Code Online (Sandbox Code Playgroud)