<?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[Undeclared Identifier(ist aber deklariert)]]></title><description><![CDATA[<p>Hi,<br />
ich habe das Problem, dass meine Implementierung der Klasse nicht den Header zu sehen scheint:</p>
<pre><code>#ifndef NAHRUNG_H
#define NAHRUNG_H
#ifndef SPEISE_H
#define SPEISE_H
#ifndef OBST_H
#define OBST_H
#ifndef APFEL_H
#define APFEL_H
#include &lt;string&gt;
using namespace std;

	Apfel::Apfel(double gewicht, double preisProKg, string sorte, bool istSuess)
	{
		this-&gt;gewicht = gewicht;
		this-&gt;preis = preisProKg*gewicht;
		this-&gt;sorte = sorte;
		this-&gt;suess = istSuess;
	}

	Apfel::string gibSorte()
	{
		return this-&gt;sorte;
	}

#endif
#endif
#endif
#endif
</code></pre>
<pre><code>class Apfel : public Obst
{
private:
	bool suess;
	string sorte;
public:
	Apfel(double gewichtInKg, double preisProKg, string sorte, bool istSuess);
	string gibSorte();
};
</code></pre>
<p>Diese Fehlermeldung bekomme ich immer wieder:</p>
<pre><code>Apfel.cpp:13:2: error: use of undeclared identifier 'Apfel'
        Apfel::Apfel(double gewicht, double preisProKg, string sorte, bo...
        ^
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/336508/undeclared-identifier-ist-aber-deklariert</link><generator>RSS for Node</generator><lastBuildDate>Sun, 19 Apr 2026 07:02:27 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/336508.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 27 Jan 2016 14:52:17 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Undeclared Identifier(ist aber deklariert) on Wed, 27 Jan 2016 14:52:17 GMT]]></title><description><![CDATA[<p>Hi,<br />
ich habe das Problem, dass meine Implementierung der Klasse nicht den Header zu sehen scheint:</p>
<pre><code>#ifndef NAHRUNG_H
#define NAHRUNG_H
#ifndef SPEISE_H
#define SPEISE_H
#ifndef OBST_H
#define OBST_H
#ifndef APFEL_H
#define APFEL_H
#include &lt;string&gt;
using namespace std;

	Apfel::Apfel(double gewicht, double preisProKg, string sorte, bool istSuess)
	{
		this-&gt;gewicht = gewicht;
		this-&gt;preis = preisProKg*gewicht;
		this-&gt;sorte = sorte;
		this-&gt;suess = istSuess;
	}

	Apfel::string gibSorte()
	{
		return this-&gt;sorte;
	}

#endif
#endif
#endif
#endif
</code></pre>
<pre><code>class Apfel : public Obst
{
private:
	bool suess;
	string sorte;
public:
	Apfel(double gewichtInKg, double preisProKg, string sorte, bool istSuess);
	string gibSorte();
};
</code></pre>
<p>Diese Fehlermeldung bekomme ich immer wieder:</p>
<pre><code>Apfel.cpp:13:2: error: use of undeclared identifier 'Apfel'
        Apfel::Apfel(double gewicht, double preisProKg, string sorte, bo...
        ^
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2484879</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2484879</guid><dc:creator><![CDATA[C++Ueber]]></dc:creator><pubDate>Wed, 27 Jan 2016 14:52:17 GMT</pubDate></item><item><title><![CDATA[Reply to Undeclared Identifier(ist aber deklariert) on Wed, 27 Jan 2016 15:02:27 GMT]]></title><description><![CDATA[<p>Dazu musst du den Header includen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2484881</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2484881</guid><dc:creator><![CDATA[Bitmapper]]></dc:creator><pubDate>Wed, 27 Jan 2016 15:02:27 GMT</pubDate></item><item><title><![CDATA[Reply to Undeclared Identifier(ist aber deklariert) on Wed, 27 Jan 2016 15:02:28 GMT]]></title><description><![CDATA[<p>Was sollen diese ifndef's? Include-Guards? Guck dir die nochmal an.<br />
Ich sehe auch nirgens ein '#include &quot;Apfel.h&quot;.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2484882</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2484882</guid><dc:creator><![CDATA[Jockelx]]></dc:creator><pubDate>Wed, 27 Jan 2016 15:02:28 GMT</pubDate></item><item><title><![CDATA[Reply to Undeclared Identifier(ist aber deklariert) on Wed, 27 Jan 2016 15:08:12 GMT]]></title><description><![CDATA[<p>Danke für die Antworten.</p>
<p>Jockelx schrieb:</p>
<blockquote>
<p>Was sollen diese ifndef's? Include-Guards? Guck dir die nochmal an.<br />
Ich sehe auch nirgens ein '#include &quot;Apfel.h&quot;.</p>
</blockquote>
<p>Ich hatte die Idee, da ich sehr viele Header habe, dass der Guard prüft, ob der jeweilige Header bereits included ist und wenn nicht soll er ihn includen. Inwiefern muss ich meinen Code modifizieren?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2484885</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2484885</guid><dc:creator><![CDATA[C++Ueber]]></dc:creator><pubDate>Wed, 27 Jan 2016 15:08:12 GMT</pubDate></item><item><title><![CDATA[Reply to Undeclared Identifier(ist aber deklariert) on Wed, 27 Jan 2016 15:15:03 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">#ifndef APFEL_H
#define APFEL_H
...
class Apfel { .... };
...
...
#endif
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2484888</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2484888</guid><dc:creator><![CDATA[klassenmethode]]></dc:creator><pubDate>Wed, 27 Jan 2016 15:15:03 GMT</pubDate></item><item><title><![CDATA[Reply to Undeclared Identifier(ist aber deklariert) on Wed, 27 Jan 2016 15:18:28 GMT]]></title><description><![CDATA[<p>C++Ueber schrieb:</p>
<blockquote>
<p>Danke für die Antworten.</p>
<p>Jockelx schrieb:</p>
<blockquote>
<p>Was sollen diese ifndef's? Include-Guards? Guck dir die nochmal an.<br />
Ich sehe auch nirgens ein '#include &quot;Apfel.h&quot;.</p>
</blockquote>
<p>Ich hatte die Idee, da ich sehr viele Header habe, dass der Guard prüft, ob der jeweilige Header bereits included ist und wenn nicht soll er ihn includen. Inwiefern muss ich meinen Code modifizieren?</p>
</blockquote>
<p>Das macht jeder Header für sich, der wird ja nicht nur in eine Datei eingebunden. (Bei größeren Projekten jedenfalls)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2484889</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2484889</guid><dc:creator><![CDATA[Bitmapper]]></dc:creator><pubDate>Wed, 27 Jan 2016 15:18:28 GMT</pubDate></item></channel></rss>