<?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 Variablen für andere Apps freigeben]]></title><description><![CDATA[<p>Hallo,</p>
<p>Wenn ich Funktionen oder Klassen in C++ schreibe die ich in einer DLL haben will,<br />
schreibe ich das so:</p>
<pre><code class="language-cpp">#define API __declspec(dllexport)

class API GlobalClass { /* ... */ };

API void GlobalFunction();
</code></pre>
<p>Wie aber muss ich das schreiben wenn ich auch Variablen global haben will?</p>
<p>So scheint das nicht zu funktionieren:</p>
<pre><code class="language-cpp">API int GlobalVariable;

// Oder so:

int API GlobalVariable;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/234788/dll-variablen-für-andere-apps-freigeben</link><generator>RSS for Node</generator><lastBuildDate>Wed, 08 Apr 2026 13:08:46 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/234788.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 22 Feb 2009 14:39:44 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to DLL Variablen für andere Apps freigeben on Sun, 22 Feb 2009 14:39:44 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>Wenn ich Funktionen oder Klassen in C++ schreibe die ich in einer DLL haben will,<br />
schreibe ich das so:</p>
<pre><code class="language-cpp">#define API __declspec(dllexport)

class API GlobalClass { /* ... */ };

API void GlobalFunction();
</code></pre>
<p>Wie aber muss ich das schreiben wenn ich auch Variablen global haben will?</p>
<p>So scheint das nicht zu funktionieren:</p>
<pre><code class="language-cpp">API int GlobalVariable;

// Oder so:

int API GlobalVariable;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1668099</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1668099</guid><dc:creator><![CDATA[LukasBanana]]></dc:creator><pubDate>Sun, 22 Feb 2009 14:39:44 GMT</pubDate></item><item><title><![CDATA[Reply to DLL Variablen für andere Apps freigeben on Sun, 22 Feb 2009 15:04:15 GMT]]></title><description><![CDATA[<p>Was scheint dabei nicht zu gehen?<br />
Schau Dir die DLL via <a href="http://www.dependencywalker.com" rel="nofollow">www.dependencywalker.com</a> an...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1668112</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1668112</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Sun, 22 Feb 2009 15:04:15 GMT</pubDate></item><item><title><![CDATA[Reply to DLL Variablen für andere Apps freigeben on Sun, 22 Feb 2009 15:07:01 GMT]]></title><description><![CDATA[<p>Naja in dem anderen Programm meckert der Compiler die jeweilige Variable wäre nicht definiert.</p>
<p>&quot;Undefined reference to ...&quot;</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1668115</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1668115</guid><dc:creator><![CDATA[LukasBanana]]></dc:creator><pubDate>Sun, 22 Feb 2009 15:07:01 GMT</pubDate></item><item><title><![CDATA[Reply to DLL Variablen für andere Apps freigeben on Sun, 22 Feb 2009 18:39:44 GMT]]></title><description><![CDATA[<p>Fehlt Dir vielleicht das dazugehörige dllimport?<br />
Simon</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1668253</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1668253</guid><dc:creator><![CDATA[theta]]></dc:creator><pubDate>Sun, 22 Feb 2009 18:39:44 GMT</pubDate></item><item><title><![CDATA[Reply to DLL Variablen für andere Apps freigeben on Mon, 23 Feb 2009 16:35:11 GMT]]></title><description><![CDATA[<p>Variable in DLLs sind gewöhnlich strikt lokal für die jeweilige Instanz der DLL. Das heisst, sie sind nur für die die DLL aufrufende Anwendung verfügbar. Du suchst aber globale Daten für mehrere Anwendungen, die dieselbe DLL benutzen. Das wird nicht von allen Compilern/Linkern direkt unterstützt, von Borland jedenfalls nicht. Interessiert mich auch, wie man das compiler-unabhängig machen kann.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1668856</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1668856</guid><dc:creator><![CDATA[berniebutt]]></dc:creator><pubDate>Mon, 23 Feb 2009 16:35:11 GMT</pubDate></item></channel></rss>