[libav-api] Undefined reference to av_register_all() during link

Jim jensen jameswjensen at centurytel.net
Fri Jan 24 23:55:10 CET 2014


Greetings,

I'm running Linux Mint 16 on a x86_64 box.  I've built libav-9.10 from
sources on your site with the commands:

./configure --prefix=/usr --enable-gpl --enabled-shared
make
sudo make  install

The code

#include <lzma.h>
#include "/usr/include/libavcodec/avcodec.h"
#include "/usr/include/libavformat/avformat.h"
#include <stdio.h>

int main(int argc, char *argv[])
{
     AVFormatContext *pFormatCtx;
     int             i, videoStream;
     AVCodecContext  *pCodecCtx;
     AVCodec         *pCodec;
     AVFrame         *pFrame;
     AVFrame         *pFrameRGB;
     int             numBytes;
     uint8_t         *buffer;

     // Register all formats and codecs
     av_register_all();
     return 0;
}

[you can see this is your sample program with most of it  commented out]

compiled with

g++ -o avcodec_sample avcodec_sample.cpp -lavformat -lavcodec -lz

produces the error "undefined reference to  'av_register_all()'" during
linking.

Since this is a really basic failure, I assume I'm doing something 
wrong.  Can you please help?

Thanks
Jim Jensen



More information about the libav-api mailing list