<?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[Was ist daran falsch?]]></title><description><![CDATA[<p>#include &lt;cstdlib&gt;<br />
#include &lt;iostream&gt;</p>
<p>using namespace std;</p>
<p>int main()<br />
{<br />
//<s><s><s><s><s><s><s><s><s><s>Variablendeklaration</s></s></s></s></s></s></s></s></s></s><br />
double geschw = 0.0000 ;<br />
double anweg = 0.0000 ;<br />
double reakweg = 0.0000 ;<br />
double bremweg = 0.0000 ;<br />
string auswahl = &quot; &quot; ;<br />
bool wiederholen = true ;<br />
//<s><s><s><s><s><s><s><s><s><s>Eingabe</s></s></s></s></s></s></s></s></s></s><br />
while (wiederholen == true)<br />
cout &lt;&lt; &quot;<s><s><s><s><s>Berechnung des Anhalteweges</s></s></s></s></s>&quot; &lt;&lt; endl;<br />
cout &lt;&lt; endl &lt;&lt; endl;<br />
cout &lt;&lt; &quot;Mit diesem Programm kannst du deinen Anhalteweg errechnen.&quot; &lt;&lt; endl;<br />
cout &lt;&lt; endl &lt;&lt; endl;<br />
cout &lt;&lt; &quot;Gib jetzt deine Geschwindigkeit an.&quot; &lt;&lt; endl;<br />
cout &lt;&lt; endl &lt;&lt; endl;<br />
cin &gt;&gt; geschw;<br />
//<s><s><s><s><s><s><s><s><s><s>Verarbeitung</s></s></s></s></s></s></s></s></s></s><br />
bremweg = ((geschw / 10 ) * (geschw / 10)) / 2 ;<br />
reakweg = (geschw / 10) * 3 ;<br />
anweg = bremweg + reakweg ;<br />
cout &lt;&lt; endl &lt;&lt; endl;<br />
//<s><s><s><s><s><s><s><s><s><s>Ausgabe</s></s></s></s></s></s></s></s></s></s><br />
cout &lt;&lt; &quot;Dein Anhalteweg ist &quot; &lt;&lt; anweg &lt;&lt; &quot; Meter.&quot; &lt;&lt; endl;<br />
cout &lt;&lt; endl &lt;&lt; endl;</p>
<p>//<s><s><s><s><s><s><s><s><s><s>Abbruch</s></s></s></s></s></s></s></s></s></s><br />
cout &lt;&lt; &quot; Moechten Sie noch eine Rechnnung durchfuehren? (Ja) &quot;;<br />
cout &lt;&lt; endl &lt;&lt; endl;<br />
cin &gt;&gt; auswahl;<br />
if ((auswahl == &quot;JA&quot;) || (auswahl == &quot;Ja&quot;) || (auswahl == &quot;J&quot;) ||<br />
(auswahl == &quot;jA&quot;) || (auswahl == &quot;ja&quot;) || (auswahl == &quot;j&quot;))<br />
{<br />
wiederholen = true;<br />
}</p>
<p>}</p>
<p>wenn ich das complimiere dann bekomm ich diese meldungen<br />
multiple definition of `main'<br />
first defined here<br />
ld returned 1 exit status<br />
C:... \Documents\Programmierung\While (anhalteweg)\Makefile.win [Build Error] [&quot;While] Error 1</p>
<p>Ps: wie kann ich das so aussehen lassen wie in der programmerstellung das zb die kommentare usw farbig sind?</p>
<p>danke im vorraus</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/296664/was-ist-daran-falsch</link><generator>RSS for Node</generator><lastBuildDate>Fri, 14 Aug 2026 19:32:31 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/296664.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 09 Dec 2011 14:14:16 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Was ist daran falsch? on Fri, 09 Dec 2011 14:16:25 GMT]]></title><description><![CDATA[<p>#include &lt;cstdlib&gt;<br />
#include &lt;iostream&gt;</p>
<p>using namespace std;</p>
<p>int main()<br />
{<br />
//<s><s><s><s><s><s><s><s><s><s>Variablendeklaration</s></s></s></s></s></s></s></s></s></s><br />
double geschw = 0.0000 ;<br />
double anweg = 0.0000 ;<br />
double reakweg = 0.0000 ;<br />
double bremweg = 0.0000 ;<br />
string auswahl = &quot; &quot; ;<br />
bool wiederholen = true ;<br />
//<s><s><s><s><s><s><s><s><s><s>Eingabe</s></s></s></s></s></s></s></s></s></s><br />
while (wiederholen == true)<br />
cout &lt;&lt; &quot;<s><s><s><s><s>Berechnung des Anhalteweges</s></s></s></s></s>&quot; &lt;&lt; endl;<br />
cout &lt;&lt; endl &lt;&lt; endl;<br />
cout &lt;&lt; &quot;Mit diesem Programm kannst du deinen Anhalteweg errechnen.&quot; &lt;&lt; endl;<br />
cout &lt;&lt; endl &lt;&lt; endl;<br />
cout &lt;&lt; &quot;Gib jetzt deine Geschwindigkeit an.&quot; &lt;&lt; endl;<br />
cout &lt;&lt; endl &lt;&lt; endl;<br />
cin &gt;&gt; geschw;<br />
//<s><s><s><s><s><s><s><s><s><s>Verarbeitung</s></s></s></s></s></s></s></s></s></s><br />
bremweg = ((geschw / 10 ) * (geschw / 10)) / 2 ;<br />
reakweg = (geschw / 10) * 3 ;<br />
anweg = bremweg + reakweg ;<br />
cout &lt;&lt; endl &lt;&lt; endl;<br />
//<s><s><s><s><s><s><s><s><s><s>Ausgabe</s></s></s></s></s></s></s></s></s></s><br />
cout &lt;&lt; &quot;Dein Anhalteweg ist &quot; &lt;&lt; anweg &lt;&lt; &quot; Meter.&quot; &lt;&lt; endl;<br />
cout &lt;&lt; endl &lt;&lt; endl;</p>
<p>//<s><s><s><s><s><s><s><s><s><s>Abbruch</s></s></s></s></s></s></s></s></s></s><br />
cout &lt;&lt; &quot; Moechten Sie noch eine Rechnnung durchfuehren? (Ja) &quot;;<br />
cout &lt;&lt; endl &lt;&lt; endl;<br />
cin &gt;&gt; auswahl;<br />
if ((auswahl == &quot;JA&quot;) || (auswahl == &quot;Ja&quot;) || (auswahl == &quot;J&quot;) ||<br />
(auswahl == &quot;jA&quot;) || (auswahl == &quot;ja&quot;) || (auswahl == &quot;j&quot;))<br />
{<br />
wiederholen = true;<br />
}</p>
<p>}</p>
<p>wenn ich das complimiere dann bekomm ich diese meldungen<br />
multiple definition of `main'<br />
first defined here<br />
ld returned 1 exit status<br />
C:... \Documents\Programmierung\While (anhalteweg)\Makefile.win [Build Error] [&quot;While] Error 1</p>
<p>Ps: wie kann ich das so aussehen lassen wie in der programmerstellung das zb die kommentare usw farbig sind?</p>
<p>danke im vorraus</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2155033</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2155033</guid><dc:creator><![CDATA[DerEineTyp]]></dc:creator><pubDate>Fri, 09 Dec 2011 14:16:25 GMT</pubDate></item><item><title><![CDATA[Reply to Was ist daran falsch? on Fri, 09 Dec 2011 14:19:02 GMT]]></title><description><![CDATA[<p>ok ich weiß es glaub ich die auswahl darf kein string sein oder?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2155037</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2155037</guid><dc:creator><![CDATA[DerEineTyp]]></dc:creator><pubDate>Fri, 09 Dec 2011 14:19:02 GMT</pubDate></item><item><title><![CDATA[Reply to Was ist daran falsch? on Fri, 09 Dec 2011 14:26:33 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">#include &lt;cstdlib&gt;
#include &lt;iostream&gt;

using namespace std; 

int main()
{
	//~~~~~~~~~~~~~~~~~~~~Variablendeklaration~~~~~~~~~~~~~~~~~~~~
	double geschw = 0.0000 ;
	double anweg = 0.0000 ;
	double reakweg = 0.0000 ;
	double bremweg = 0.0000 ;
	string auswahl = &quot; &quot; ;
	bool wiederholen = true ;

	//~~~~~~~~~~~~~~~~~~~~Eingabe~~~~~~~~~~~~~~~~~~~~
	while (wiederholen == true)
		cout &lt;&lt; &quot;~~~~~~~~~~Berechnung des Anhalteweges~~~~~~~~~~&quot; &lt;&lt; endl;

	cout &lt;&lt; endl &lt;&lt; endl;
	cout &lt;&lt; &quot;Mit diesem Programm kannst du deinen Anhalteweg errechnen.&quot; &lt;&lt; endl;
	cout &lt;&lt; endl &lt;&lt; endl;
	cout &lt;&lt; &quot;Gib jetzt deine Geschwindigkeit an.&quot; &lt;&lt; endl;
	cout &lt;&lt; endl &lt;&lt; endl;
	cin &gt;&gt; geschw;

	//~~~~~~~~~~~~~~~~~~~~Verarbeitung~~~~~~~~~~~~~~~~~~~~
	bremweg = ((geschw / 10 ) * (geschw / 10)) / 2 ;
	reakweg = (geschw / 10) * 3 ;
	anweg = bremweg + reakweg ;
	cout &lt;&lt; endl &lt;&lt; endl;

	//~~~~~~~~~~~~~~~~~~~~Ausgabe~~~~~~~~~~~~~~~~~~~~
	cout &lt;&lt; &quot;Dein Anhalteweg ist &quot; &lt;&lt; anweg &lt;&lt; &quot; Meter.&quot; &lt;&lt; endl;
	cout &lt;&lt; endl &lt;&lt; endl;

	//~~~~~~~~~~~~~~~~~~~~Abbruch~~~~~~~~~~~~~~~~~~~~
	cout &lt;&lt; &quot; Moechten Sie noch eine Rechnnung durchfuehren? (Ja) &quot;;
	cout &lt;&lt; endl &lt;&lt; endl;
	cin &gt;&gt; auswahl;
	if ((auswahl == &quot;JA&quot;) || (auswahl == &quot;Ja&quot;) || (auswahl == &quot;J&quot;) ||
		(auswahl == &quot;jA&quot;) || (auswahl == &quot;ja&quot;) || (auswahl == &quot;j&quot;))
	{
		wiederholen = true;
	}
}
</code></pre>
<p>und wie wir sehen läuft hier einiges schief. bei deiner while schleife fehlen geschweifte klammern, nicht dass es den compiler stören würde, aber es hat einen anderen effekt als du denkst <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /><br />
am ende fehlt ein return 0; und für std::string brauchst du den header string und nicht cstdlib</p>
<p>aber ansonsten sieht der code halbwegs ok aus, rein syntaktisch betrachtet natürlich</p>
<p>und die fehlermeldung sagt was ganz adneres als du in deinem 2. post anmaßt. kann es sein dass du uns etwas quellcode verheimlichst? so wie du es hier geschrieben hast, hast du eine main funktion definiert, da sollte eig kein std konformer compiler meckern von wegen multiple definition...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2155038</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2155038</guid><dc:creator><![CDATA[Skym0sh0]]></dc:creator><pubDate>Fri, 09 Dec 2011 14:26:33 GMT</pubDate></item><item><title><![CDATA[Reply to Was ist daran falsch? on Fri, 09 Dec 2011 14:47:18 GMT]]></title><description><![CDATA[<p>benutze Dev-C++ und wenn man da ein Projekt erstellt, dann wird das:</p>
<p>#include &lt;cstdlib&gt;<br />
#include &lt;iostream&gt;</p>
<p>using namespace std;</p>
<p>automatisch erstellt.</p>
<p>noch was bin eigentlich noch blutiger anfänger und lerne halt alles in der schule also ich kann nciht wirklich was mit den fachbegriffen was anfangen also sry aber &quot;header string und nicht cstdlib&quot; sagt mir nichts^^</p>
<p>aber quellcode verheimliche ich nicht</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2155048</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2155048</guid><dc:creator><![CDATA[DerEineTyp]]></dc:creator><pubDate>Fri, 09 Dec 2011 14:47:18 GMT</pubDate></item><item><title><![CDATA[Reply to Was ist daran falsch? on Fri, 09 Dec 2011 14:50:40 GMT]]></title><description><![CDATA[<p>DerEineTyp schrieb:</p>
<blockquote>
<p>benutze Dev-C++ und wenn man da ein Projekt erstellt, dann wird das:</p>
<p>#include &lt;cstdlib&gt;<br />
#include &lt;iostream&gt;</p>
<p>using namespace std;</p>
<p>automatisch erstellt.</p>
<p>noch was bin eigentlich noch blutiger anfänger und lerne halt alles in der schule also ich kann nciht wirklich was mit den fachbegriffen was anfangen also sry aber &quot;header string und nicht cstdlib&quot; sagt mir nichts^^</p>
<p>aber quellcode verheimliche ich nicht</p>
</blockquote>
<p>über #include &lt;header&gt; inkuldierst du header dateien. und du sollst nicht #include &lt;cstdlib&gt; nehmen, sondern #include &lt;string&gt;</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2155049</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2155049</guid><dc:creator><![CDATA[zuckerlie]]></dc:creator><pubDate>Fri, 09 Dec 2011 14:50:40 GMT</pubDate></item><item><title><![CDATA[Reply to Was ist daran falsch? on Fri, 09 Dec 2011 15:03:07 GMT]]></title><description><![CDATA[<p>danke an euch beiden aber das hat nicht wirklich was genützt.<br />
hab den header geändert, die geschweiften klammern und return 0 geschrieben.</p>
<p>funktioniert immer noch nicht<br />
immer noch die gleichen meldungen</p>
<p>multiple definition of <code>main' first defined here multiple definition of</code>main'<br />
first defined here<br />
ld returned 1 exit status<br />
C:... \Documents\Programmierung\While (anhalteweg)\Makefile.win [Build Error] [&quot;While] Error 1</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2155053</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2155053</guid><dc:creator><![CDATA[DerEineTyp]]></dc:creator><pubDate>Fri, 09 Dec 2011 15:03:07 GMT</pubDate></item><item><title><![CDATA[Reply to Was ist daran falsch? on Fri, 09 Dec 2011 15:07:42 GMT]]></title><description><![CDATA[<p>Gib mal deinen Quellcode und bitte mit CodeTags. Unter der Eingabe für Nachrichten steht C/C++ dazwischen</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2155059</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2155059</guid><dc:creator><![CDATA[zuckerlie]]></dc:creator><pubDate>Fri, 09 Dec 2011 15:07:42 GMT</pubDate></item><item><title><![CDATA[Reply to Was ist daran falsch? on Fri, 09 Dec 2011 15:07:59 GMT]]></title><description><![CDATA[<p>Steht doch da. Du hast in deinem Projekt vermutlich mehrere .cpp Dateien mit main-Funktionen. Das funktioniert so nicht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2155060</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2155060</guid><dc:creator><![CDATA[314159265358979]]></dc:creator><pubDate>Fri, 09 Dec 2011 15:07:59 GMT</pubDate></item><item><title><![CDATA[Reply to Was ist daran falsch? on Fri, 09 Dec 2011 15:10:31 GMT]]></title><description><![CDATA[<p>zuckerlie schrieb:</p>
<blockquote>
<p>Gib mal deinen Quellcode und bitte mit CodeTags. Unter der Eingabe für Nachrichten steht C/C++ dazwischen</p>
</blockquote>
<p>sry aber hab keine ahnung was du von mir willst^^</p>
<p>das hier vllt?</p>
<p>Compiler: Default compiler<br />
Building Makefile: &quot;C:... \Documents\Programmierung\While (anhalteweg)\Makefile.win&quot;<br />
Führt make... aus<br />
make.exe -f &quot;C:... \Documents\Programmierung\While (anhalteweg)\Makefile.win&quot; all<br />
g++.exe -c While.cpp -o While.o -I&quot;C:/Dev/bloodshed/lib/gcc/mingw32/3.4.2/include&quot; -I&quot;C:/Dev/bloodshed/include/c++/3.4.2/backward&quot; -I&quot;C:/Dev/bloodshed/include/c++/3.4.2/mingw32&quot; -I&quot;C:/Dev/bloodshed/include/c++/3.4.2&quot; -I&quot;C:/Dev/bloodshed/include&quot;</p>
<p>g++.exe While.o ../Anhalteweg/main.o ../Umrechner/Umwandeln.o -o &quot;While Schleife.exe&quot; -L&quot;C:/Dev/bloodshed/lib&quot;</p>
<p>../Anhalteweg/main.o(.text+0x100):main.cpp: multiple definition of <code>main' While.o(.text+0x100):While.cpp: first defined here ../Umrechner/Umwandeln.o(.text+0x100):Umwandeln.cpp: multiple definition of</code>main'<br />
While.o(.text+0x100):While.cpp: first defined here<br />
collect2: ld returned 1 exit status</p>
<p>make.exe: *** [&quot;While] Error 1</p>
<p>Ausführung beendet</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2155062</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2155062</guid><dc:creator><![CDATA[DerEineTyp]]></dc:creator><pubDate>Fri, 09 Dec 2011 15:10:31 GMT</pubDate></item><item><title><![CDATA[Reply to Was ist daran falsch? on Fri, 09 Dec 2011 15:14:00 GMT]]></title><description><![CDATA[<p>Du linkst zwei Dateien zusammen, die beide eine Funktion namens main haben. Wenn nun ein Programm erstellt werden soll (was im Prinzip ein Aufrufen der main-Funktion ist), dann ist unklar, welche der beiden Funktionen genommen werden soll.</p>
<p>edit: Mit der genauen Fehlermeldung wird klar:<br />
../Anhalteweg/main.o<br />
und<br />
../Umrechner/Umwandeln.o<br />
und<br />
While.o</p>
<p>enthalten alle eine Definition von main.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2155063</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2155063</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Fri, 09 Dec 2011 15:14:00 GMT</pubDate></item><item><title><![CDATA[Reply to Was ist daran falsch? on Fri, 09 Dec 2011 15:11:51 GMT]]></title><description><![CDATA[<p>Ich möchte dass du deinen aktuellen Quelltext postest. <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>
]]></description><link>https://www.c-plusplus.net/forum/post/2155065</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2155065</guid><dc:creator><![CDATA[zuckerlie]]></dc:creator><pubDate>Fri, 09 Dec 2011 15:11:51 GMT</pubDate></item><item><title><![CDATA[Reply to Was ist daran falsch? on Fri, 09 Dec 2011 15:11:56 GMT]]></title><description><![CDATA[<p>314159265358979 schrieb:</p>
<blockquote>
<p>Steht doch da. Du hast in deinem Projekt vermutlich mehrere .cpp Dateien mit main-Funktionen. Das funktioniert so nicht.</p>
</blockquote>
<p>ich habe mehrer projekte geöffnet in einem fenster meinste das?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2155066</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2155066</guid><dc:creator><![CDATA[DerEineTyp]]></dc:creator><pubDate>Fri, 09 Dec 2011 15:11:56 GMT</pubDate></item><item><title><![CDATA[Reply to Was ist daran falsch? on Fri, 09 Dec 2011 15:16:30 GMT]]></title><description><![CDATA[<p>SeppJ hatte recht lag daran das ich mehrere .cpp dateien aufeinma geöffnet hatte</p>
<p>th an alle funzelt jetzt einwand frei</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2155068</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2155068</guid><dc:creator><![CDATA[DerEineTyp]]></dc:creator><pubDate>Fri, 09 Dec 2011 15:16:30 GMT</pubDate></item><item><title><![CDATA[Reply to Was ist daran falsch? on Fri, 09 Dec 2011 15:17:39 GMT]]></title><description><![CDATA[<p>DerEineTyp schrieb:</p>
<blockquote>
<p>SeppJ hatte recht lag daran das ich mehrere .cpp dateien aufeinma geöffnet hatte</p>
<p>th an alle funzelt jetzt einwand frei</p>
</blockquote>
<p>Ich wette deine IDE bietet die Möglichkeit, mehrere Projekte parallel zu bearbeiten, wenn du dich nur auskennst :xmas2: .</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2155069</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2155069</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Fri, 09 Dec 2011 15:17:39 GMT</pubDate></item></channel></rss>