Also since you're using gcc, i think you need to enclose your #includes within and extern "C"  { }<br><br><div class="gmail_quote">On Mon, Oct 17, 2011 at 6:47 PM, Alex Cohn <span dir="ltr"><<a href="mailto:alexcohn@netvision.net.il">alexcohn@netvision.net.il</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im"><p>On Oct 17, 2011 8:39 PM, "Fernando Vasconcellos" <<a href="mailto:fernandovsv@gmail.com" target="_blank">fernandovsv@gmail.com</a>> wrote:<br>

><br>
> Hi,<br>
><br>
> Im trying to manipulate libavformat and libavcodec for some streaming project that im participating but some problems are on my way.<br>
><br>
> Here is a simple code that i cant compile.<br>
><br>
> #include <libavcodec/avcodec.h><br>
> #include <libavformat/avformat.h><br>
><br>
><br>
> #include <stdio.h><br>
> #include <stdlib.h><br>
> #include <stdbool.h><br>
><br>
> int main (int argc, const char * argv[]) {<br>
> av_register_all();<br>
><br>
> return 0;<br>
> }<br>
><br>
> compiled with: gcc -o tutorial01 teste.c -lavformat -lavcodec -lz -lm</p>
</div><p>You should add -lavutil and maybe other libraries too to your gcc command line.</p>
<p>Good luck,<br><font color="#888888">
Alex</font></p><div><div></div><div class="h5">
<p>> with this ffmpeg version:<br>
> ffmpeg version N-33135-g3b0e242, Copyright (c) 2000-2011 the FFmpeg developers<br>
>   built on Oct  3 2011 14:26:14 with gcc 4.5.2<br>
>   configuration: --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-nonfree --enable-postproc --enable-version3 --enable-x11grab<br>


>   libavutil    51. 18. 0 / 51. 18. 0<br>
>   libavcodec   <a href="tel:53.%2019.%200%20%2F%2053.%2019.%200" value="+15319053190" target="_blank">53. 19. 0 / 53. 19. 0</a><br>
>   libavformat  <a href="tel:53.%2013.%200%20%2F%2053.%2013.%200" value="+15313053130" target="_blank">53. 13. 0 / 53. 13. 0</a><br>
>   libavdevice  53.  4. 0 / 53.  4. 0<br>
>   libavfilter   2. 43. 6 /  2. 43. 6<br>
>   libswscale    2.  1. 0 /  2.  1. 0<br>
>   libpostproc  51.  2. 0 / 51.  2. 0<br>
><br>
><br>
> Erros returned:<br>
> /usr/local/lib/libavcodec.a(mjpeg2jpeg_bsf.o): In function `mjpeg2jpeg_filter':<br>
> /home/fernandovsv/ffmpeg/libavcodec/mjpeg2jpeg_bsf.c:98: undefined reference to `av_malloc'<br>
> /home/fernandovsv/ffmpeg/libavcodec/mjpeg2jpeg_bsf.c:88: undefined reference to `av_log'</p>
</div></div><br>_______________________________________________<br>
Libav-user mailing list<br>
<a href="mailto:Libav-user@ffmpeg.org">Libav-user@ffmpeg.org</a><br>
<a href="http://ffmpeg.org/mailman/listinfo/libav-user" target="_blank">http://ffmpeg.org/mailman/listinfo/libav-user</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>-<br>-<br>-<br>-<br>Luke Clemens<br><a href="http://clemens.bytehammer.com">http://clemens.bytehammer.com</a><br>