I'm trying to build simple programm using ffmpeg
#include <stdio.h>
#include <stdlib.h>
#define __STDC_CONSTANT_MACROS
extern "C" {
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libavformat/avio.h>
#include <libavdevice/avdevice.h>
#include <libavutil/time.h>
}
#include <iostream>
int main( int argc, char* argv[] )
{
AVCodec *icodec;
AVFormatContext *ifcx = NULL;
AVInputFormat *ifmt;
AVCodecContext *iccx;
AVStream *ist;
AVStream *ost;
AVPacket pkt;
int i_index;
int64_t timenow, timestart;
int got_key_frame = 0;
AVFormatContext *ofcx;
const char *sProg = argv[ 0 ];
const char *sFileInput;
const char *sFileOutput;
int64_t bRunTime;
bRunTime = atoi( argv[ 2 ] ) * 1000000;
// Initialize library
av_log_set_level( AV_LOG_DEBUG );
av_register_all();
avcodec_register_all();
avformat_network_init();
avdevice_register_all();
And i get these errors
g++ -o rtsp3 -I/usr/include -I/usr/local/include rtsp3.cpp -lavformat -lavcodec -lavutil -lm -lz -lva -lpthread
/tmp/ccAXDgvi.o: In function main':
rtsp3.cpp:(.text+0x115): undefined reference to
avdevice_register_all'
/usr/local/lib/libavformat.a(matroskadec.o): In function matroska_decode_buffer':
/home/user/projects/ffmpeg-git/ffmpeg/libavformat/matroskadec.c:1242: undefined reference to
BZ2_bzDecompressInit'
/home/user/projects/ffmpeg-git/ffmpeg/libavformat/matroskadec.c:1257: undefined reference to BZ2_bzDecompress'
/home/user/projects/ffmpeg-git/ffmpeg/libavformat/matroskadec.c:1250: undefined reference to
BZ2_bzDecompressEnd'
/home/user/projects/ffmpeg-git/ffmpeg/libavformat/matroskadec.c:1262: undefined reference to `BZ2_bzDecompressEnd'
collect2: error: ld returned 1 exit status
I have git version of ffmpeg and successfully compiled it and make install.