<?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[OOP]]></title><description><![CDATA[<p>Hi Leute!</p>
<p>Wollte grad mal OOP in c++ machen, nur will das nich so wie ich<br />
will.</p>
<p>ich schreib mir ein Klasse in einer header</p>
<pre><code class="language-cpp">#ifndef _TANK_H
#define _TANK_H
class Tank
{
private:
	float m_Volume;
public:
	Tank()
	{
		m_Volume=1000.0f;
	}
	float getVolume();
};
#endif
</code></pre>
<p>dann mach ich mir ne cpp-datei</p>
<pre><code class="language-cpp">#include &quot;tank.h&quot;

float Tank::getVolume()
{
	return m_Volume;
}
</code></pre>
<p>so und nun binde ich das in meine programm ein, aber er gibt mir ständig fehler<br />
meldungen wie</p>
<p>ank.obj : error LNK2005: &quot;public: float __thiscall Tank::getVolume(void)&quot; (?getVolume@Tank@@QAEMXZ) already defined in oop.obj<br />
Debug/test oop.exe : fatal error LNK1169: one or more multiply defined symbols found</p>
<p>wenn ich alles in die header daeit schreibe und dann in mein programm einbinde<br />
gehts. bin recht ratlos:(</p>
<p>vielleicht wisst ihr waum, danke schonmal</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/155075/oop</link><generator>RSS for Node</generator><lastBuildDate>Tue, 08 Sep 2026 02:28:37 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/155075.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 02 Aug 2006 12:54:12 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to OOP on Wed, 02 Aug 2006 12:54:12 GMT]]></title><description><![CDATA[<p>Hi Leute!</p>
<p>Wollte grad mal OOP in c++ machen, nur will das nich so wie ich<br />
will.</p>
<p>ich schreib mir ein Klasse in einer header</p>
<pre><code class="language-cpp">#ifndef _TANK_H
#define _TANK_H
class Tank
{
private:
	float m_Volume;
public:
	Tank()
	{
		m_Volume=1000.0f;
	}
	float getVolume();
};
#endif
</code></pre>
<p>dann mach ich mir ne cpp-datei</p>
<pre><code class="language-cpp">#include &quot;tank.h&quot;

float Tank::getVolume()
{
	return m_Volume;
}
</code></pre>
<p>so und nun binde ich das in meine programm ein, aber er gibt mir ständig fehler<br />
meldungen wie</p>
<p>ank.obj : error LNK2005: &quot;public: float __thiscall Tank::getVolume(void)&quot; (?getVolume@Tank@@QAEMXZ) already defined in oop.obj<br />
Debug/test oop.exe : fatal error LNK1169: one or more multiply defined symbols found</p>
<p>wenn ich alles in die header daeit schreibe und dann in mein programm einbinde<br />
gehts. bin recht ratlos:(</p>
<p>vielleicht wisst ihr waum, danke schonmal</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1109199</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1109199</guid><dc:creator><![CDATA[adonis]]></dc:creator><pubDate>Wed, 02 Aug 2006 12:54:12 GMT</pubDate></item><item><title><![CDATA[Reply to OOP on Wed, 02 Aug 2006 13:00:12 GMT]]></title><description><![CDATA[<p>ich glaub du hast es mit der Ordnung übertrieben <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /> :</p>
<pre><code class="language-cpp">[code]class Tank
{
private:
    float m_Volume;
public:
    Tank()
    {
        m_Volume=1000.0f;
    }
    float getVolume();
};
[/code]
</code></pre>
<p>und</p>
<pre><code>[cpp]#ifndef _TANK_H
#define _TANK_H
#include &quot;tank.h&quot;

float Tank::getVolume()
{
    return m_Volume;
}
#endif[/cpp]
</code></pre>
<p>oder lass mal das #ifndef #define und#endif mal ganz weg.<br />
funzt es dann?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1109207</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1109207</guid><dc:creator><![CDATA[ESS_CB]]></dc:creator><pubDate>Wed, 02 Aug 2006 13:00:12 GMT</pubDate></item><item><title><![CDATA[Reply to OOP on Wed, 02 Aug 2006 13:08:38 GMT]]></title><description><![CDATA[<p>wenn ich</p>
<pre><code class="language-cpp">#ifndef _TANK_H
#define _TANK_H

Klasse

#endif
</code></pre>
<p>weglasse gehts auch nicht, soll nur vor mehrfach includierung schützen.</p>
<p>das mein header.</p>
<p>dann kommt meine tank.cpp</p>
<pre><code class="language-cpp">#include &quot;tank.h&quot;

float Tank::getVolume()
{
	return m_Volume;
}
</code></pre>
<p>und dann meine main</p>
<pre><code class="language-cpp">#include &lt;iostream.h&gt;
#include &quot;Tank.cpp&quot;

float main()
{
	Tank myTank;
	cin.get();
	return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1109215</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1109215</guid><dc:creator><![CDATA[adonis]]></dc:creator><pubDate>Wed, 02 Aug 2006 13:08:38 GMT</pubDate></item><item><title><![CDATA[Reply to OOP on Wed, 02 Aug 2006 13:13:54 GMT]]></title><description><![CDATA[<p>Sorry, ESS_CB, aber was du geschrieben hast, ist vollkommener Blödsinn.</p>
<p>adonis, dein erster Entwurf war vollkommen korrekt. Aber du darfst die Tank.cpp nicht inkludieren.</p>
<p>Edit: Wenn wir schon mal dabei sind:</p>
<p>Bitte &lt;iostream&gt; statt &lt;iostream.h&gt;</p>
<p>und std::cin statt cin</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1109219</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1109219</guid><dc:creator><![CDATA[Z2]]></dc:creator><pubDate>Wed, 02 Aug 2006 13:13:54 GMT</pubDate></item><item><title><![CDATA[Reply to OOP on Wed, 02 Aug 2006 13:14:29 GMT]]></title><description><![CDATA[<p>Das Problem kenne ich. Ich benutze Visual c++ .NET, den Spass habe ich oefters. Wenn ich das ganze in DevCpp mache klappts. Ich denke das ist'n Bug, da nicht mal ein komplettes rebuilt was nutzt. Lösch' mal die .obj von Hand, und probiers dann nochmal</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1109223</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1109223</guid><dc:creator><![CDATA[bumbytie]]></dc:creator><pubDate>Wed, 02 Aug 2006 13:14:29 GMT</pubDate></item><item><title><![CDATA[Reply to OOP on Wed, 02 Aug 2006 13:16:51 GMT]]></title><description><![CDATA[<p>bumbytie schrieb:</p>
<blockquote>
<p>Das Problem kenne ich. Ich benutze Visual c++ .NET, den Spass habe ich oefters. Wenn ich das ganze in DevCpp mache klappts. Ich denke das ist'n Bug, da nicht mal ein komplettes rebuilt was nutzt. Lösch' mal die .obj von Hand, und probiers dann nochmal</p>
</blockquote>
<p>Nö, das is kein Bug von VC. Das is vollkommen korrekt!</p>
<p>grüße</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1109226</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1109226</guid><dc:creator><![CDATA[David_pb]]></dc:creator><pubDate>Wed, 02 Aug 2006 13:16:51 GMT</pubDate></item><item><title><![CDATA[Reply to OOP on Wed, 02 Aug 2006 13:19:40 GMT]]></title><description><![CDATA[<p>ok hab jetzt statt tank.pp die tank.h eingebunden und es geht.<br />
danke:)</p>
<p>wo liegt der unterschied bei iostream und iostream.h,<br />
weiss nicht mehr ob ich mich richtig erinnere die ohne .h<br />
waren nen fester standart währen die andern ein wenig anders sein können?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1109230</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1109230</guid><dc:creator><![CDATA[adonis]]></dc:creator><pubDate>Wed, 02 Aug 2006 13:19:40 GMT</pubDate></item><item><title><![CDATA[Reply to OOP on Wed, 02 Aug 2006 13:22:25 GMT]]></title><description><![CDATA[<p>Die Datei iostream.h gibst im Standar<strong>d</strong> nicht. Richtig, laut Standar<strong>d</strong> ist iostream (ohne .h).</p>
<p>grüße</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1109232</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1109232</guid><dc:creator><![CDATA[David_pb]]></dc:creator><pubDate>Wed, 02 Aug 2006 13:22:25 GMT</pubDate></item><item><title><![CDATA[Reply to OOP on Wed, 02 Aug 2006 13:46:12 GMT]]></title><description><![CDATA[<p>ich hab jetzt mal beide eingebunden die tank.h und die tank.cpp<br />
das geht auch und zudem stehen mir die auswahllisten zu verfügung.</p>
<p>also wenn ich nen objekt erstelle <a href="http://myobject.xxx" rel="nofollow">myobject.xxx</a><br />
da kommt ja immer ne liste wo ich eine methode auswählen kann.</p>
<p>wenn ich nur die header einbinde sind die weg.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1109255</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1109255</guid><dc:creator><![CDATA[adonis]]></dc:creator><pubDate>Wed, 02 Aug 2006 13:46:12 GMT</pubDate></item><item><title><![CDATA[Reply to OOP on Wed, 02 Aug 2006 13:52:04 GMT]]></title><description><![CDATA[<p>nur die tank.h einbinden!</p>
<p>die cpp datei stellt eine separate übersetzungseinheit dar, und die darf nicht eingebunden werden.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1109260</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1109260</guid><dc:creator><![CDATA[otze]]></dc:creator><pubDate>Wed, 02 Aug 2006 13:52:04 GMT</pubDate></item><item><title><![CDATA[Reply to OOP on Wed, 02 Aug 2006 13:58:11 GMT]]></title><description><![CDATA[<p>ok:)</p>
<p>irgendwie is vc++ ein wenig komisch.<br />
jetzt hab ich sie wieder rausgenommen nun hat er die methodenlisten.</p>
<p>danke für eure hilfe.</p>
<p>erster meilenstein geschafft hehe</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1109267</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1109267</guid><dc:creator><![CDATA[adonis]]></dc:creator><pubDate>Wed, 02 Aug 2006 13:58:11 GMT</pubDate></item></channel></rss>