after having compile ffmpeg 6 in Debian 12 with this configure line ./configure --enable-shared I'm trying to compile my first program based on ffmpeg. The source is very short:
extern "C" { // ininfluent
#include "libavcodec/avcodec.h"
}
int main(int argc, char *argv[])
{
AVCodecContext *dec_ctx;
AVPacket *pkt;
avcodec_send_packet(dec_ctx, pkt);
return 0;
}
and this is the compile line
gcc -I../../ffmpeg-6.0/ -L. -lavcodec -lavdevice -lavfilter -lavformat -lavutil -lpostproc -lswresample -lswscale main2.cpp
The problem is that I obtain the link error
/usr/bin/ld: /tmp/ccFDv2V6.o: in function `main':
main2.cpp:(.text+0x1e): undefined reference to `avcodec_send_packet'
collect2: error: ld returned 1 exit status
The function avcodec_send_packet
exists and it in in the right library.
What do I need to do to resolve this error?