<div dir="ltr"><div>Hello,</div><div><br></div><div>I just started playing with libav and tried very simple demo that doesn't work whatever I tried.</div><div><br></div><div>This is my demo code:<br></div><div><br></div><div>main.c</div><div>--------------</div><div><div>#include <stdlib.h></div><div>#include <stdio.h></div><div>#include <string.h></div><div><br></div><div>#ifdef HAVE_AV_CONFIG_H</div><div>#undef HAVE_AV_CONFIG_H</div><div>#endif</div><div><br></div><div>#include "libavcodec/avcodec.h"</div><div>#include "libavutil/mathematics.h"</div><div><br></div><div>#define INBUF_SIZE 4096</div><div>#define AUDIO_INBUF_SIZE 20480</div><div>#define AUDIO_REFILL_THRESH 4096</div><div><br></div><div>int main(int argc, char **argv)</div><div>{</div><div>    const char *filename;</div><div><br></div><div>    /* must be called before using avcodec lib */</div><div>    avcodec_register_all();</div><div><br></div><div>    printf("Done!\r\n");</div><div>    return 0;</div><div>}</div></div><div><br></div><div><br></div><div>I compile it using:</div><div><br></div><div><div>i686-w64-mingw32.static-gcc -I/home/alex/opt/mxe/usr/i686-w64-mingw32.static/include main.c -L/home/alex/opt/mxe/usr/i686-w64-mingw32.static/lib  -lavformat -lavcodec -lavutil -lswscale -lmp3lame -lvorbis -lvorbisenc -lxvidcore -pthread -ltheora -lx264 -lz -lbz2 -lm -llzma -lswscale -lswresample</div></div><div><br></div><div>I get this error:</div><div><div>/home/alex/opt/mxe/usr/i686-w64-mingw32.static/lib/libavcodec.a(libopencore-amr.o):libopencore-amr.c:(.text+0x72): undefined reference to `Decoder_Interface_Decode'</div><div>/home/alex/opt/mxe/usr/i686-w64-mingw32.static/lib/libavcodec.a(libopencore-amr.o):libopencore-amr.c:(.text+0xd0): undefined reference to `D_IF_exit'</div><div>/home/alex/opt/mxe/usr/i686-w64-mingw32.static/lib/libavcodec.a(libopencore-amr.o):libopencore-amr.c:(.text+0x152): undefined reference to `D_IF_decode'</div><div>/home/alex/opt/mxe/usr/i686-w64-mingw32.static/lib/libavcodec.a(libopencore-amr.o):libopencore-amr.c:(.text+0x574): undefined reference to `Encoder_Interface_Encode'</div><div>/home/alex/opt/mxe/usr/bin/i686-w64-mingw32.static-ld: /home/alex/opt/mxe/usr/i686-w64-mingw32.static/lib/libavcodec.a(libopencore-amr.o): bad reloc address 0x0 in section `.data'</div><div>/home/alex/opt/mxe/usr/bin/i686-w64-mingw32.static-ld: final link failed: Invalid operation</div><div>collect2: error: ld returned 1 exit status</div></div><div><br></div><div>libav was compiled statically on Ubuntu with MXE (<a href="https://github.com/mxe/mxe">https://github.com/mxe/mxe</a> master) cross-build i686-mingw-w64</div><div><br></div><div>Please help me with this first build to start playing with libav cool things.<br></div><div><br></div><div>Thanks!</div><div><br></div><div>-Alex</div><div><br></div><div><br></div></div>