<?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[Wann muss ich Lib linken?]]></title><description><![CDATA[<p>Mahlzeit!</p>
<p>Ich habe eine statische Bibliothek libFoo.a mit einer Funktion FooFunc:</p>
<pre><code class="language-cpp">#include &lt;osg/Viewer&gt;
class Creator { ... };

void FooFunc() {

   osg::Viewer viewer; // Das hier ist definiert in libosgViewer.so

}
</code></pre>
<p>FooFunc benutzt die Klasse osg::Viewer aus OpenSceneGraph (steht in <a href="http://libosgViewer.so" rel="nofollow">libosgViewer.so</a>). Dh. libFoo.a linkt gegen <a href="http://libosgViewer.so" rel="nofollow">libosgViewer.so</a>.</p>
<p>So, jetzt benutze ich in meinem Code (der ein Executable erzeugt) die Funktion FooFunc() aus libFoo.a. Dh mein executable linkt libFoo.a.</p>
<p>Jetzt kriege ich komischerweise solche LinkerFehler</p>
<blockquote>
<p>Creator.cpp:(.text+0x310): undefined reference to `osgViewer::Viewer::Viewer()'</p>
</blockquote>
<p>Muss ich jetzt zu meinem Executable auch gegen <a href="http://libosgViewer.so" rel="nofollow">libosgViewer.so</a> linken?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/289032/wann-muss-ich-lib-linken</link><generator>RSS for Node</generator><lastBuildDate>Wed, 19 Aug 2026 16:11:50 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/289032.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 27 Jun 2011 12:21:43 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Wann muss ich Lib linken? on Mon, 27 Jun 2011 12:21:43 GMT]]></title><description><![CDATA[<p>Mahlzeit!</p>
<p>Ich habe eine statische Bibliothek libFoo.a mit einer Funktion FooFunc:</p>
<pre><code class="language-cpp">#include &lt;osg/Viewer&gt;
class Creator { ... };

void FooFunc() {

   osg::Viewer viewer; // Das hier ist definiert in libosgViewer.so

}
</code></pre>
<p>FooFunc benutzt die Klasse osg::Viewer aus OpenSceneGraph (steht in <a href="http://libosgViewer.so" rel="nofollow">libosgViewer.so</a>). Dh. libFoo.a linkt gegen <a href="http://libosgViewer.so" rel="nofollow">libosgViewer.so</a>.</p>
<p>So, jetzt benutze ich in meinem Code (der ein Executable erzeugt) die Funktion FooFunc() aus libFoo.a. Dh mein executable linkt libFoo.a.</p>
<p>Jetzt kriege ich komischerweise solche LinkerFehler</p>
<blockquote>
<p>Creator.cpp:(.text+0x310): undefined reference to `osgViewer::Viewer::Viewer()'</p>
</blockquote>
<p>Muss ich jetzt zu meinem Executable auch gegen <a href="http://libosgViewer.so" rel="nofollow">libosgViewer.so</a> linken?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2084788</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2084788</guid><dc:creator><![CDATA[Linkii]]></dc:creator><pubDate>Mon, 27 Jun 2011 12:21:43 GMT</pubDate></item><item><title><![CDATA[Reply to Wann muss ich Lib linken? on Mon, 27 Jun 2011 14:30:17 GMT]]></title><description><![CDATA[<p>ja, denn eine statische libs enhalten keine informationen über abhängikeiten.<br />
die .a dateien sind unter linux nichts anderes als ein archiv, welche alle objektdateien (kompilierte .c/.cpp dateien) enthält.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2084860</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2084860</guid><dc:creator><![CDATA[firefly]]></dc:creator><pubDate>Mon, 27 Jun 2011 14:30:17 GMT</pubDate></item></channel></rss>