<?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[statische variablen &amp;quot;finden&amp;quot;]]></title><description><![CDATA[<p>hallo</p>
<p>ich habe gerade das Problem dass die statischen klassenvariablen nicht gefunden werden - anschein fuktioniert die sache anders als ich denke, aber ich kann nicht drauf verzichten, da es noch lange vor der &quot;geburt&quot; der Klasse bekannt sein soll ob diese Klasse überhaupt zum einsatz kommt.</p>
<p>Hier ein Beispiel</p>
<pre><code class="language-cpp">class A
{
	public:
		static void setS( int _s ) { s = _s; };
	private:
		static int s;
};

int main( )
{
	A::setS(100);

	return 0;
}
</code></pre>
<p>und es heißt dann:</p>
<blockquote>
<blockquote>
<p>g++ <a href="http://defTast.cc" rel="nofollow">defTast.cc</a><br />
/tmp/ccI8yOds.o: In function <code>A::setS(int)': defTast.cc:(.text._ZN1A4setSEi\[A::setS(int)\]+0x7): undefined reference to</code>A::s'<br />
collect2: ld returned 1 exit status</p>
</blockquote>
</blockquote>
<p>Was ist das Problem dabei?</p>
<p>Danke</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/288332/statische-variablen-quot-finden-quot</link><generator>RSS for Node</generator><lastBuildDate>Thu, 20 Aug 2026 01:26:58 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/288332.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 15 Jun 2011 01:47:34 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to statische variablen &amp;quot;finden&amp;quot; on Wed, 15 Jun 2011 01:49:53 GMT]]></title><description><![CDATA[<p>hallo</p>
<p>ich habe gerade das Problem dass die statischen klassenvariablen nicht gefunden werden - anschein fuktioniert die sache anders als ich denke, aber ich kann nicht drauf verzichten, da es noch lange vor der &quot;geburt&quot; der Klasse bekannt sein soll ob diese Klasse überhaupt zum einsatz kommt.</p>
<p>Hier ein Beispiel</p>
<pre><code class="language-cpp">class A
{
	public:
		static void setS( int _s ) { s = _s; };
	private:
		static int s;
};

int main( )
{
	A::setS(100);

	return 0;
}
</code></pre>
<p>und es heißt dann:</p>
<blockquote>
<blockquote>
<p>g++ <a href="http://defTast.cc" rel="nofollow">defTast.cc</a><br />
/tmp/ccI8yOds.o: In function <code>A::setS(int)': defTast.cc:(.text._ZN1A4setSEi\[A::setS(int)\]+0x7): undefined reference to</code>A::s'<br />
collect2: ld returned 1 exit status</p>
</blockquote>
</blockquote>
<p>Was ist das Problem dabei?</p>
<p>Danke</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2078238</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2078238</guid><dc:creator><![CDATA[Feld]]></dc:creator><pubDate>Wed, 15 Jun 2011 01:49:53 GMT</pubDate></item><item><title><![CDATA[Reply to statische variablen &amp;quot;finden&amp;quot; on Wed, 15 Jun 2011 02:17:04 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">class A
{
    public:
        static void setS( int _s ) { s = _s; };
    private:
        static int s;
};

int A::s;

int main( )
{
    A::setS(100);

    return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2078239</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2078239</guid><dc:creator><![CDATA[volkard]]></dc:creator><pubDate>Wed, 15 Jun 2011 02:17:04 GMT</pubDate></item><item><title><![CDATA[Reply to statische variablen &amp;quot;finden&amp;quot; on Wed, 15 Jun 2011 06:09:19 GMT]]></title><description><![CDATA[<p>Einfach mal in die FAQ schauen, dort gibts eine Übersicht, die auch den Wortlaut deiner Fehlermeldung &quot;undefined reference&quot; enthält. Der Link bringt dich dann hierhin:<br />
<a href="http://www.c-plusplus.net/forum/246875" rel="nofollow">http://www.c-plusplus.net/forum/246875</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2078258</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2078258</guid><dc:creator><![CDATA[pumuckl]]></dc:creator><pubDate>Wed, 15 Jun 2011 06:09:19 GMT</pubDate></item></channel></rss>