<?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[&amp;quot;class&amp;quot; type redefinition [HILFE]]]></title><description><![CDATA[<p>Hi Community <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /><br />
Ich habe leider ein Problem wo ich absolut keine Ahnung hab warum?!? und kann auch keine Fehler entdeckn trotzdem sind sie da <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
<p>Hier ist die Compiler-Ausgabe :</p>
<pre><code class="language-cpp">1&gt;------ Erstellen gestartet: Projekt: shape_klasse, Konfiguration: Debug Win32 ------
1&gt;Kompilieren...
1&gt;shape_klasse.cpp
1&gt;e:\vc c-c++ projects\jetzt_lerne_ich_cpp\teil_5\kapitel_18\shape_klasse\shape_klasse\cshape.h(9) : error C2011: 'CShape' : 'class' type redefinition
1&gt;        e:\vc c-c++ projects\jetzt_lerne_ich_cpp\teil_5\kapitel_18\shape_klasse\shape_klasse\cshape.h(9) : see declaration of 'CShape'
1&gt;e:\vc c-c++ projects\jetzt_lerne_ich_cpp\teil_5\kapitel_18\shape_klasse\shape_klasse\ccircle.h(10) : error C2504: 'CShape' : base class undefined
1&gt;e:\vc c-c++ projects\jetzt_lerne_ich_cpp\teil_5\kapitel_18\shape_klasse\shape_klasse\crectangle.h(10) : error C2504: 'CShape' : base class undefined
1&gt;e:\vc c-c++ projects\jetzt_lerne_ich_cpp\teil_5\kapitel_18\shape_klasse\shape_klasse\shape_klasse.cpp(24) : error C2440: '=' : cannot convert from 'CCircle *' to 'CShape *'
1&gt;        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1&gt;e:\vc c-c++ projects\jetzt_lerne_ich_cpp\teil_5\kapitel_18\shape_klasse\shape_klasse\shape_klasse.cpp(26) : error C2440: '=' : cannot convert from 'CRectangle *' to 'CShape *'
1&gt;        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1&gt;e:\vc c-c++ projects\jetzt_lerne_ich_cpp\teil_5\kapitel_18\shape_klasse\shape_klasse\shape_klasse.cpp(28) : error C2440: '=' : cannot convert from 'CSquare *' to 'CShape *'
1&gt;        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1&gt;e:\vc c-c++ projects\jetzt_lerne_ich_cpp\teil_5\kapitel_18\shape_klasse\shape_klasse\shape_klasse.cpp(38) : error C2027: use of undefined type 'CShape'
1&gt;        e:\vc c-c++ projects\jetzt_lerne_ich_cpp\teil_5\kapitel_18\shape_klasse\shape_klasse\cshape.h(9) : see declaration of 'CShape'
1&gt;e:\vc c-c++ projects\jetzt_lerne_ich_cpp\teil_5\kapitel_18\shape_klasse\shape_klasse\shape_klasse.cpp(38) : error C2227: left of '-&gt;Draw' must point to class/struct/union/generic type
1&gt;Generating Code...
1&gt;Compiling...
1&gt;CShape.cpp
1&gt;Generating Code...
1&gt;Compiling...
1&gt;CCircle.cpp
1&gt;CRectangle.cpp
1&gt;CSquare.cpp
1&gt;Generating Code...
1&gt;Das Buildprotokoll wurde unter &quot;file://e:\VC C-C++ Projects\jetzt_lerne_ich_cpp\teil_5\kapitel_18\shape_klasse\shape_klasse\Debug\BuildLog.htm&quot; gespeichert.
1&gt;shape_klasse - 8 Fehler, 0 Warnung(en)
========== Erstellen: 0 erfolgreich, Fehler bei 1, 0 aktuell, 0 übersprungen ==========
</code></pre>
<p>und hier ist die Hauptklasse von der alle andern Klassen erben</p>
<pre><code class="language-cpp">// -------------------------------------------------------------
// INCLUDES
// -------------------------------------------------------------

#include &quot;stdafx.h&quot;

// -------------------------------------------------------------

class CShape {
public:
	CShape() { }
	~CShape() { }

	virtual long GetArea() { return(-1); }	// Fehler
	virtual long GetPerim() { return(-1); }
	virtual void Draw() { }

// private:
};
</code></pre>
<p>Leider versteh ich schon folgende Compiler-Ausgabe nicht :</p>
<p><strong>1&gt;e:\vc c-c++ projects\jetzt_lerne_ich_cpp\teil_5\kapitel_18\shape_klasse\shape_klasse\cshape.h(9) : error C2011: 'CShape' : 'class' type redefinition</strong></p>
<p>Kann mir vllt jem. bitte helfen?</p>
<p>danke<br />
lg c4f</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/218607/quot-class-quot-type-redefinition-hilfe</link><generator>RSS for Node</generator><lastBuildDate>Fri, 09 Oct 2026 00:37:35 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/218607.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 22 Jul 2008 20:56:48 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to &amp;quot;class&amp;quot; type redefinition [HILFE] on Tue, 22 Jul 2008 20:56:48 GMT]]></title><description><![CDATA[<p>Hi Community <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /><br />
Ich habe leider ein Problem wo ich absolut keine Ahnung hab warum?!? und kann auch keine Fehler entdeckn trotzdem sind sie da <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
<p>Hier ist die Compiler-Ausgabe :</p>
<pre><code class="language-cpp">1&gt;------ Erstellen gestartet: Projekt: shape_klasse, Konfiguration: Debug Win32 ------
1&gt;Kompilieren...
1&gt;shape_klasse.cpp
1&gt;e:\vc c-c++ projects\jetzt_lerne_ich_cpp\teil_5\kapitel_18\shape_klasse\shape_klasse\cshape.h(9) : error C2011: 'CShape' : 'class' type redefinition
1&gt;        e:\vc c-c++ projects\jetzt_lerne_ich_cpp\teil_5\kapitel_18\shape_klasse\shape_klasse\cshape.h(9) : see declaration of 'CShape'
1&gt;e:\vc c-c++ projects\jetzt_lerne_ich_cpp\teil_5\kapitel_18\shape_klasse\shape_klasse\ccircle.h(10) : error C2504: 'CShape' : base class undefined
1&gt;e:\vc c-c++ projects\jetzt_lerne_ich_cpp\teil_5\kapitel_18\shape_klasse\shape_klasse\crectangle.h(10) : error C2504: 'CShape' : base class undefined
1&gt;e:\vc c-c++ projects\jetzt_lerne_ich_cpp\teil_5\kapitel_18\shape_klasse\shape_klasse\shape_klasse.cpp(24) : error C2440: '=' : cannot convert from 'CCircle *' to 'CShape *'
1&gt;        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1&gt;e:\vc c-c++ projects\jetzt_lerne_ich_cpp\teil_5\kapitel_18\shape_klasse\shape_klasse\shape_klasse.cpp(26) : error C2440: '=' : cannot convert from 'CRectangle *' to 'CShape *'
1&gt;        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1&gt;e:\vc c-c++ projects\jetzt_lerne_ich_cpp\teil_5\kapitel_18\shape_klasse\shape_klasse\shape_klasse.cpp(28) : error C2440: '=' : cannot convert from 'CSquare *' to 'CShape *'
1&gt;        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1&gt;e:\vc c-c++ projects\jetzt_lerne_ich_cpp\teil_5\kapitel_18\shape_klasse\shape_klasse\shape_klasse.cpp(38) : error C2027: use of undefined type 'CShape'
1&gt;        e:\vc c-c++ projects\jetzt_lerne_ich_cpp\teil_5\kapitel_18\shape_klasse\shape_klasse\cshape.h(9) : see declaration of 'CShape'
1&gt;e:\vc c-c++ projects\jetzt_lerne_ich_cpp\teil_5\kapitel_18\shape_klasse\shape_klasse\shape_klasse.cpp(38) : error C2227: left of '-&gt;Draw' must point to class/struct/union/generic type
1&gt;Generating Code...
1&gt;Compiling...
1&gt;CShape.cpp
1&gt;Generating Code...
1&gt;Compiling...
1&gt;CCircle.cpp
1&gt;CRectangle.cpp
1&gt;CSquare.cpp
1&gt;Generating Code...
1&gt;Das Buildprotokoll wurde unter &quot;file://e:\VC C-C++ Projects\jetzt_lerne_ich_cpp\teil_5\kapitel_18\shape_klasse\shape_klasse\Debug\BuildLog.htm&quot; gespeichert.
1&gt;shape_klasse - 8 Fehler, 0 Warnung(en)
========== Erstellen: 0 erfolgreich, Fehler bei 1, 0 aktuell, 0 übersprungen ==========
</code></pre>
<p>und hier ist die Hauptklasse von der alle andern Klassen erben</p>
<pre><code class="language-cpp">// -------------------------------------------------------------
// INCLUDES
// -------------------------------------------------------------

#include &quot;stdafx.h&quot;

// -------------------------------------------------------------

class CShape {
public:
	CShape() { }
	~CShape() { }

	virtual long GetArea() { return(-1); }	// Fehler
	virtual long GetPerim() { return(-1); }
	virtual void Draw() { }

// private:
};
</code></pre>
<p>Leider versteh ich schon folgende Compiler-Ausgabe nicht :</p>
<p><strong>1&gt;e:\vc c-c++ projects\jetzt_lerne_ich_cpp\teil_5\kapitel_18\shape_klasse\shape_klasse\cshape.h(9) : error C2011: 'CShape' : 'class' type redefinition</strong></p>
<p>Kann mir vllt jem. bitte helfen?</p>
<p>danke<br />
lg c4f</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1551995</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1551995</guid><dc:creator><![CDATA[c4f]]></dc:creator><pubDate>Tue, 22 Jul 2008 20:56:48 GMT</pubDate></item><item><title><![CDATA[Reply to &amp;quot;class&amp;quot; type redefinition [HILFE] on Tue, 22 Jul 2008 21:07:47 GMT]]></title><description><![CDATA[<p>Headerguards?</p>
<pre><code class="language-cpp">#ifndef SHAPE_H
#define SHAPE_H
// -------------------------------------------------------------
// INCLUDES
// -------------------------------------------------------------

#include &quot;stdafx.h&quot;

// -------------------------------------------------------------

class CShape {
public:
    CShape() { }
    ~CShape() { }

    virtual long GetArea() { return(-1); }    // Fehler
    virtual long GetPerim() { return(-1); }
    virtual void Draw() { }

// private:
};
#endif //SHAPE_H
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1551999</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1551999</guid><dc:creator><![CDATA[drakon]]></dc:creator><pubDate>Tue, 22 Jul 2008 21:07:47 GMT</pubDate></item><item><title><![CDATA[Reply to &amp;quot;class&amp;quot; type redefinition [HILFE] on Wed, 23 Jul 2008 03:55:55 GMT]]></title><description><![CDATA[<p>drakon vermutet (und wird wohl damit Recht haben), dass dein Header mehrmals eingebunden wird. Beim zweiten Mal findet dann natrürlich die angemeckerte Redefinition der Klasse statt. Das kannst du mit den Include-Guards aus drakons Beispiel oder alternativ mit einem &quot;#pragma once&quot; am Anfang des Headers verhindern. Die Guards sind aber eigentlich besser, da du so noch für andere Zwecke abfragen kannst, ob SHAPE_H bereits definiert wurde (#ifdef, #ifndef, #if defined()).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1552082</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1552082</guid><dc:creator><![CDATA[_matze]]></dc:creator><pubDate>Wed, 23 Jul 2008 03:55:55 GMT</pubDate></item><item><title><![CDATA[Reply to &amp;quot;class&amp;quot; type redefinition [HILFE] on Wed, 23 Jul 2008 13:09:47 GMT]]></title><description><![CDATA[<p>Hey <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":]"
      alt="🙂"
    /><br />
Tut mir leid wegen der späten Antwort war leider nicht zuhaus <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
<p>Ich hab's versucht und funktionierte auch...danke <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /><br />
schönen Tag noch <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title="=)"
      alt="🙂"
    /></p>
<p>lg c4f</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1552401</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1552401</guid><dc:creator><![CDATA[c4f]]></dc:creator><pubDate>Wed, 23 Jul 2008 13:09:47 GMT</pubDate></item></channel></rss>