<?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[DLL: Instanzierung von Klassen ohne Quelldatei?]]></title><description><![CDATA[<p>Hallo,<br />
zur Zeit arbeite ich an meiner kleinen eigenen Engine. Um später komfortabel ein neues Spiel erstellen zu können, stelle ich mir in etwa so etwas vor:</p>
<pre><code class="language-cpp">#include &lt;MyEngine.hpp&gt;

using namespace MyEngine;

int main(int argc, char **argv)
{
    Application app(argc, argv); // um diese Zeile geht es
    // mach irgendwas

    return app.Run();
}
</code></pre>
<p>Wie man sieht, versuche ich in meinem Spiel eine Instanz der Klasse <code>Application</code> zu erstellen.<br />
Mein Problem ist nun, dass dies nur gelingt, wenn ich die <code>Application.cpp</code> einbinde.<br />
Somit müsste sie jedes mal neu erstellt werden.<br />
Da dies an mehreren Stellen auftritt, möchte ich das gerne vermeiden, und nur die Headerdateien, die .dll und die .lib ausliefern.</p>
<p>Wie realisiere ich das?</p>
<p>Gruß und Danke!</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/293893/dll-instanzierung-von-klassen-ohne-quelldatei</link><generator>RSS for Node</generator><lastBuildDate>Sun, 16 Aug 2026 02:55:35 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/293893.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 12 Oct 2011 22:00:00 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to DLL: Instanzierung von Klassen ohne Quelldatei? on Wed, 12 Oct 2011 22:00:00 GMT]]></title><description><![CDATA[<p>Hallo,<br />
zur Zeit arbeite ich an meiner kleinen eigenen Engine. Um später komfortabel ein neues Spiel erstellen zu können, stelle ich mir in etwa so etwas vor:</p>
<pre><code class="language-cpp">#include &lt;MyEngine.hpp&gt;

using namespace MyEngine;

int main(int argc, char **argv)
{
    Application app(argc, argv); // um diese Zeile geht es
    // mach irgendwas

    return app.Run();
}
</code></pre>
<p>Wie man sieht, versuche ich in meinem Spiel eine Instanz der Klasse <code>Application</code> zu erstellen.<br />
Mein Problem ist nun, dass dies nur gelingt, wenn ich die <code>Application.cpp</code> einbinde.<br />
Somit müsste sie jedes mal neu erstellt werden.<br />
Da dies an mehreren Stellen auftritt, möchte ich das gerne vermeiden, und nur die Headerdateien, die .dll und die .lib ausliefern.</p>
<p>Wie realisiere ich das?</p>
<p>Gruß und Danke!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2130744</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2130744</guid><dc:creator><![CDATA[theliquidwave]]></dc:creator><pubDate>Wed, 12 Oct 2011 22:00:00 GMT</pubDate></item><item><title><![CDATA[Reply to DLL: Instanzierung von Klassen ohne Quelldatei? on Wed, 12 Oct 2011 22:09:48 GMT]]></title><description><![CDATA[<p>Hast du mal in Qt programmiert ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2130747</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2130747</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Wed, 12 Oct 2011 22:09:48 GMT</pubDate></item><item><title><![CDATA[Reply to DLL: Instanzierung von Klassen ohne Quelldatei? on Wed, 12 Oct 2011 22:26:59 GMT]]></title><description><![CDATA[<p>Kompiliere deine Engine statt zu einer Anwendung (.exe) zu einer statischen (.lib) oder einer dynamischen (.lib + .dll) Bibliothek. Wie das genau funktioniert, steht in der Dokumentation deines Compilers. Im entsprechenden Unterforum bist du besser aufgehoben.</p>
<p>P.S.: Ich würde unbedingt Namensräume benutzen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2130753</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2130753</guid><dc:creator><![CDATA[Nexus]]></dc:creator><pubDate>Wed, 12 Oct 2011 22:26:59 GMT</pubDate></item><item><title><![CDATA[Reply to DLL: Instanzierung von Klassen ohne Quelldatei? on Thu, 13 Oct 2011 06:10:49 GMT]]></title><description><![CDATA[<blockquote>
<p>statischen (.lib) oder einer dynamischen (.lib + .dll) Bibliothek</p>
</blockquote>
<p>Das tue ich bereits. Und mehr ist nicht nötig? Ich werde es nachher mal testen. Aber ich meine, dass ich dann einen Linkererror bekommen habe, dass <code>Application</code> undefinierte Symbole hat bzw. selbst eines ist.</p>
<blockquote>
<p>Hast du mal in Qt programmiert ?</p>
</blockquote>
<p>Nein, dass war nur ein Beispiel. Ich weiß, dass es Qt ähnlich sieht.</p>
<blockquote>
<p>P.S.: Ich würde unbedingt Namensräume benutzen.</p>
</blockquote>
<p>Habe ich doch getan. Oder meinst du, dass ich jedes mal <code>MyEngine::</code> davor schreiben sollte? Oder noch besser, mehrere, verschachtelte Namensräume?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2130783</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2130783</guid><dc:creator><![CDATA[theliquidwave]]></dc:creator><pubDate>Thu, 13 Oct 2011 06:10:49 GMT</pubDate></item><item><title><![CDATA[Reply to DLL: Instanzierung von Klassen ohne Quelldatei? on Thu, 13 Oct 2011 10:09:07 GMT]]></title><description><![CDATA[<p>Hast du die &quot;lib&quot;-Datei denn auch zu deinem Projekt hinzugelinkt?<br />
Bzw. den korrekten Pfad zu der Datei angegeben?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2130889</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2130889</guid><dc:creator><![CDATA[Th69]]></dc:creator><pubDate>Thu, 13 Oct 2011 10:09:07 GMT</pubDate></item><item><title><![CDATA[Reply to DLL: Instanzierung von Klassen ohne Quelldatei? on Thu, 13 Oct 2011 12:03:12 GMT]]></title><description><![CDATA[<p>theliquidwave schrieb:</p>
<blockquote>
<p>Oder meinst du, dass ich jedes mal <code>MyEngine::</code> davor schreiben sollte?</p>
</blockquote>
<p>Ja. Namensräume zu schreiben, nur um sie jedes Mal mit <code>using namespace</code> wieder auszuleeren, macht nur begrenzt Sinn. Dein Namensraum-Bezeichner kann ja auch eine Abkürzung mit 2-5 Buchstaben sein.</p>
<p>theliquidwave schrieb:</p>
<blockquote>
<p>Oder noch besser, mehrere, verschachtelte Namensräume?</p>
</blockquote>
<p>Würde ich nur, falls von der Gliederung einen Vorteil hast.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2130938</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2130938</guid><dc:creator><![CDATA[Nexus]]></dc:creator><pubDate>Thu, 13 Oct 2011 12:03:12 GMT</pubDate></item><item><title><![CDATA[Reply to DLL: Instanzierung von Klassen ohne Quelldatei? on Thu, 13 Oct 2011 19:44:02 GMT]]></title><description><![CDATA[<p>So, habe es mal getestet. Folgendes Problem: Es wird erst eine <code>.lib-Datei</code> erstellt, wenn ich irgendwo in der DLL ein <code>__declspec(dllexport)</code> verwende.</p>
<p>Das sagt mir</p>
<p>a) dass die <code>.lib</code> nur externe Verweise enthält<br />
b) sie keine Klassenimplementationen enthält</p>
<p>Wie schon befürchtet gibt es einen Linkererror, wenn ich eine Instanz von <code>Application</code> erstellen will.</p>
<p>Muss ich irgendwas umstellen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2131125</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2131125</guid><dc:creator><![CDATA[theliquidwave]]></dc:creator><pubDate>Thu, 13 Oct 2011 19:44:02 GMT</pubDate></item><item><title><![CDATA[Reply to DLL: Instanzierung von Klassen ohne Quelldatei? on Thu, 13 Oct 2011 19:59:19 GMT]]></title><description><![CDATA[<p>theliquidwave schrieb:</p>
<blockquote>
<p>Folgendes Problem: Es wird erst eine <code>.lib-Datei</code> erstellt, wenn ich irgendwo in der DLL ein <code>__declspec(dllexport)</code> verwende.</p>
</blockquote>
<p>Natürlich, sonst exportierst du ja keine Symbole und brauchst entsprechend keine Import-Bibliothek (.lib-Datei).</p>
<p>theliquidwave schrieb:</p>
<blockquote>
<p>Muss ich irgendwas umstellen?</p>
</blockquote>
<p>Ja, <code>__declspec(dllimport)</code> . Auf MSDN wird der ganze Prozess ausführlich beschrieben.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2131138</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2131138</guid><dc:creator><![CDATA[Nexus]]></dc:creator><pubDate>Thu, 13 Oct 2011 19:59:19 GMT</pubDate></item></channel></rss>