<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[ffmpeg, g++, cygwin und eine &amp;quot;undefined reference&amp;quot;]]></title><description><![CDATA[<p>Hallo zusammen,</p>
<p>ich möchte mich ein wenig in ffmpeg einarbeiten und habe mich zu diesem Zweck an das auf <a href="http://ffmpeg.org" rel="nofollow">ffmpeg.org</a> verlinkte Tutorial (<a href="http://www.inb.uni-luebeck.de/~boehme/using_libavcodec.html" rel="nofollow">http://www.inb.uni-luebeck.de/~boehme/using_libavcodec.html</a>) gewagt. Das ganze mit cygwin und g++ unter Windows. Ffmpeg ist kompiliert und installiert, die Cpp-Datei aus dem Tutorial (avcodec_sample.cpp) habe ich wie folgt kompiliert:</p>
<pre><code>g++ -o avcodec_sample.exe -Wall -lavutil -lavcodec -lavformat -lswscale -lz -lm avcodec_sample.cpp
</code></pre>
<p>Folgender Fehler tritt dann auf (nicht nur zweimal, aber das soll jetzt mal genügen):</p>
<pre><code>/cygdrive/c/WINNT/.../Temp/ccT8J4Yf.o:avcodec_sample.cpp:(.text+0x50): undefined reference to `avcodec_decode_video(AVCodecContext*, AVFrame*, int*, unsigned char const*, int)'
/cygdrive/c/WINNT/.../Temp/ccT8J4Yf.o:avcodec_sample.cpp:(.text+0xc9): undefined reference to `av_read_packet(AVFormatContext*, AVPacket*)'
...
</code></pre>
<p>Das sind die Includes der Cpp-Datei:</p>
<pre><code class="language-cpp">#include &lt;libavcodec/avcodec.h&gt;
#include &lt;libavformat/avformat.h&gt;
#include &lt;libswscale/swscale.h&gt;

#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;
</code></pre>
<p>Und schließlich noch mein <code>/usr/local</code> -Verzeichnis:</p>
<pre><code>+---bin
+---etc
+---include
|   +---libavcodec
|   |       avcodec.h
|   |       opt.h
|   |       vdpau.h
|   |       
|   +---libavdevice
|   |       avdevice.h
|   |       
|   +---libavformat
|   |       avformat.h
|   |       avio.h
|   |       rtsp.h
|   |       rtspcodes.h
|   |       
|   +---libavutil
|   |       adler32.h
|   |       avstring.h
|   |       avutil.h
|   |       base64.h
|   |       common.h
|   |       crc.h
|   |       fifo.h
|   |       intfloat_readwrite.h
|   |       log.h
|   |       lzo.h
|   |       mathematics.h
|   |       md5.h
|   |       mem.h
|   |       random.h
|   |       rational.h
|   |       sha1.h
|   |       
|   \---libswscale
|           swscale.h
|           
\---lib
    |   libavcodec.a
    |   libavdevice.a
    |   libavformat.a
    |   libavutil.a
    |   libswscale.a
    |   
    \---pkgconfig
            libavcodec.pc
            libavdevice.pc
            libavformat.pc
            libavutil.pc
            libswscale.pc
</code></pre>
<p>Eigentlich müssten alle benötigten Libraries da sein. Den Library-Pfad mit -L händisch zu setzen habe ich auch schon probiert, hat aber nichts geändert. Auch das Ändern der Reihenfolge der Linkerdirektiven hat keine Auswirkungen. Ich hoffe, das waren jetzt nicht zu viele Informationen auf einmal und bin dankbar für jeden Hinweis.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/254492/ffmpeg-g-cygwin-und-eine-quot-undefined-reference-quot</link><generator>RSS for Node</generator><lastBuildDate>Tue, 08 Sep 2026 18:54:00 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/254492.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 17 Nov 2009 08:06:37 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to ffmpeg, g++, cygwin und eine &amp;quot;undefined reference&amp;quot; on Tue, 17 Nov 2009 08:06:37 GMT]]></title><description><![CDATA[<p>Hallo zusammen,</p>
<p>ich möchte mich ein wenig in ffmpeg einarbeiten und habe mich zu diesem Zweck an das auf <a href="http://ffmpeg.org" rel="nofollow">ffmpeg.org</a> verlinkte Tutorial (<a href="http://www.inb.uni-luebeck.de/~boehme/using_libavcodec.html" rel="nofollow">http://www.inb.uni-luebeck.de/~boehme/using_libavcodec.html</a>) gewagt. Das ganze mit cygwin und g++ unter Windows. Ffmpeg ist kompiliert und installiert, die Cpp-Datei aus dem Tutorial (avcodec_sample.cpp) habe ich wie folgt kompiliert:</p>
<pre><code>g++ -o avcodec_sample.exe -Wall -lavutil -lavcodec -lavformat -lswscale -lz -lm avcodec_sample.cpp
</code></pre>
<p>Folgender Fehler tritt dann auf (nicht nur zweimal, aber das soll jetzt mal genügen):</p>
<pre><code>/cygdrive/c/WINNT/.../Temp/ccT8J4Yf.o:avcodec_sample.cpp:(.text+0x50): undefined reference to `avcodec_decode_video(AVCodecContext*, AVFrame*, int*, unsigned char const*, int)'
/cygdrive/c/WINNT/.../Temp/ccT8J4Yf.o:avcodec_sample.cpp:(.text+0xc9): undefined reference to `av_read_packet(AVFormatContext*, AVPacket*)'
...
</code></pre>
<p>Das sind die Includes der Cpp-Datei:</p>
<pre><code class="language-cpp">#include &lt;libavcodec/avcodec.h&gt;
#include &lt;libavformat/avformat.h&gt;
#include &lt;libswscale/swscale.h&gt;

#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;
</code></pre>
<p>Und schließlich noch mein <code>/usr/local</code> -Verzeichnis:</p>
<pre><code>+---bin
+---etc
+---include
|   +---libavcodec
|   |       avcodec.h
|   |       opt.h
|   |       vdpau.h
|   |       
|   +---libavdevice
|   |       avdevice.h
|   |       
|   +---libavformat
|   |       avformat.h
|   |       avio.h
|   |       rtsp.h
|   |       rtspcodes.h
|   |       
|   +---libavutil
|   |       adler32.h
|   |       avstring.h
|   |       avutil.h
|   |       base64.h
|   |       common.h
|   |       crc.h
|   |       fifo.h
|   |       intfloat_readwrite.h
|   |       log.h
|   |       lzo.h
|   |       mathematics.h
|   |       md5.h
|   |       mem.h
|   |       random.h
|   |       rational.h
|   |       sha1.h
|   |       
|   \---libswscale
|           swscale.h
|           
\---lib
    |   libavcodec.a
    |   libavdevice.a
    |   libavformat.a
    |   libavutil.a
    |   libswscale.a
    |   
    \---pkgconfig
            libavcodec.pc
            libavdevice.pc
            libavformat.pc
            libavutil.pc
            libswscale.pc
</code></pre>
<p>Eigentlich müssten alle benötigten Libraries da sein. Den Library-Pfad mit -L händisch zu setzen habe ich auch schon probiert, hat aber nichts geändert. Auch das Ändern der Reihenfolge der Linkerdirektiven hat keine Auswirkungen. Ich hoffe, das waren jetzt nicht zu viele Informationen auf einmal und bin dankbar für jeden Hinweis.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1809180</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1809180</guid><dc:creator><![CDATA[B_Rheinland]]></dc:creator><pubDate>Tue, 17 Nov 2009 08:06:37 GMT</pubDate></item><item><title><![CDATA[Reply to ffmpeg, g++, cygwin und eine &amp;quot;undefined reference&amp;quot; on Wed, 18 Nov 2009 09:20:43 GMT]]></title><description><![CDATA[<p>was ist denn dein ziel<br />
was willst du denn mit ffmeg machen</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1809759</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1809759</guid><dc:creator><![CDATA[junkyffmpeg]]></dc:creator><pubDate>Wed, 18 Nov 2009 09:20:43 GMT</pubDate></item><item><title><![CDATA[Reply to ffmpeg, g++, cygwin und eine &amp;quot;undefined reference&amp;quot; on Wed, 18 Nov 2009 10:23:50 GMT]]></title><description><![CDATA[<p>Bei allem Respekt, aber ich denke, das würde jetzt den Rahmen sprengen und die Diskussion weg von dem eigentlichen Thema führen. Im Augenblick möchte ich das Linker-Problem lösen und nicht darüber diskutieren, was mein Programm können soll oder warum ich ffmpeg gewählt habe.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1809783</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1809783</guid><dc:creator><![CDATA[B_Rheinland]]></dc:creator><pubDate>Wed, 18 Nov 2009 10:23:50 GMT</pubDate></item><item><title><![CDATA[Reply to ffmpeg, g++, cygwin und eine &amp;quot;undefined reference&amp;quot; on Wed, 27 Jan 2010 12:15:16 GMT]]></title><description><![CDATA[<p>Könnte es sein, dass die libraries ein C signature haben und der linker eine C++ funktion sucht?</p>
<p>Sprich wurden die Header über</p>
<p>extern &quot;C&quot; {<br />
#unclude &lt;avcodec.h&gt;<br />
}</p>
<p>eingebunden?</p>
<p>/c</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1845652</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1845652</guid><dc:creator><![CDATA[&#x2F;c]]></dc:creator><pubDate>Wed, 27 Jan 2010 12:15:16 GMT</pubDate></item></channel></rss>