<?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[Compilen unter Linux]]></title><description><![CDATA[<p>Moin,</p>
<p>Mich würde mal interessieren, wie man unter Linux einen C++ Code Compiliert.<br />
Erstmal ein paar Daten:</p>
<p>Betriebssystem:<br />
Ubuntu 7.10</p>
<p>Complier:<br />
GCC</p>
<p>Code:</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
using namespace std;

int main()

{
	cout&lt;&lt;&quot;Hello World!&quot;;
	return(0);
}
</code></pre>
<p>Wenn ich das ganze in der Shell Compilieren möchte, bekomm ich nur folgenden output:</p>
<blockquote>
<p>markus@m-desktop:~/Desktop/blah$ gcc test.cpp<br />
/tmp/ccgJZr4W.o: In function <code>\_\_static\_initialization\_and\_destruction_0(int, int)': test.cpp:(.text+0x23): undefined reference to</code>std::ios_base::Init::Init()'<br />
/tmp/ccgJZr4W.o: In function <code>\_\_tcf\_0': test.cpp:(.text+0x6c): undefined reference to</code>std::ios_base::Init::~Init()'<br />
/tmp/ccgJZr4W.o: In function <code>main': test.cpp:(.text+0x8e): undefined reference to</code>std::cout'<br />
test.cpp:(.text+0x93): undefined reference to <code>std::basic\_ostream&lt;char, std::char\_traits&lt;char&gt; &gt;&amp; std::operator&lt;&lt; &lt;std::char\_traits&lt;char&gt; &gt;(std::basic\_ostream&lt;char, std::char_traits&lt;char&gt; &gt;&amp;, char const*)' /tmp/ccgJZr4W.o:(.eh\_frame+0x11): undefined reference to</code>__gxx_personality_v0'<br />
collect2: ld returned 1 exit status</p>
</blockquote>
<p>Hoffe ihr könnt mir helfen. <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/topic/200955/compilen-unter-linux</link><generator>RSS for Node</generator><lastBuildDate>Mon, 05 Oct 2026 06:05:30 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/200955.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 21 Dec 2007 23:35:15 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Compilen unter Linux on Fri, 21 Dec 2007 23:35:15 GMT]]></title><description><![CDATA[<p>Moin,</p>
<p>Mich würde mal interessieren, wie man unter Linux einen C++ Code Compiliert.<br />
Erstmal ein paar Daten:</p>
<p>Betriebssystem:<br />
Ubuntu 7.10</p>
<p>Complier:<br />
GCC</p>
<p>Code:</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
using namespace std;

int main()

{
	cout&lt;&lt;&quot;Hello World!&quot;;
	return(0);
}
</code></pre>
<p>Wenn ich das ganze in der Shell Compilieren möchte, bekomm ich nur folgenden output:</p>
<blockquote>
<p>markus@m-desktop:~/Desktop/blah$ gcc test.cpp<br />
/tmp/ccgJZr4W.o: In function <code>\_\_static\_initialization\_and\_destruction_0(int, int)': test.cpp:(.text+0x23): undefined reference to</code>std::ios_base::Init::Init()'<br />
/tmp/ccgJZr4W.o: In function <code>\_\_tcf\_0': test.cpp:(.text+0x6c): undefined reference to</code>std::ios_base::Init::~Init()'<br />
/tmp/ccgJZr4W.o: In function <code>main': test.cpp:(.text+0x8e): undefined reference to</code>std::cout'<br />
test.cpp:(.text+0x93): undefined reference to <code>std::basic\_ostream&lt;char, std::char\_traits&lt;char&gt; &gt;&amp; std::operator&lt;&lt; &lt;std::char\_traits&lt;char&gt; &gt;(std::basic\_ostream&lt;char, std::char_traits&lt;char&gt; &gt;&amp;, char const*)' /tmp/ccgJZr4W.o:(.eh\_frame+0x11): undefined reference to</code>__gxx_personality_v0'<br />
collect2: ld returned 1 exit status</p>
</blockquote>
<p>Hoffe ihr könnt mir helfen. <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/1424662</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1424662</guid><dc:creator><![CDATA[**s23**]]></dc:creator><pubDate>Fri, 21 Dec 2007 23:35:15 GMT</pubDate></item><item><title><![CDATA[Reply to Compilen unter Linux on Fri, 21 Dec 2007 23:47:45 GMT]]></title><description><![CDATA[<p>Mit &quot;gcc&quot; rufst du den c Kompiler auf, dein Programm ist aber c++.Den c++ Kompiler rufst du mit &quot;g++&quot; auf.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1424667</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1424667</guid><dc:creator><![CDATA[Tanren]]></dc:creator><pubDate>Fri, 21 Dec 2007 23:47:45 GMT</pubDate></item><item><title><![CDATA[Reply to Compilen unter Linux on Sat, 22 Dec 2007 00:06:39 GMT]]></title><description><![CDATA[<p>Dankeschön <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>Jetzt jedoch eine weitere Frage, wie bekomme ich aus dem a.out eine ausführbare Datei, muss die noch irgendwie gelinkt werden o.Ä.?<br />
Bekomme nämlich nichts ausgegeben beim öffnen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1424670</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1424670</guid><dc:creator><![CDATA[**s23**]]></dc:creator><pubDate>Sat, 22 Dec 2007 00:06:39 GMT</pubDate></item><item><title><![CDATA[Reply to Compilen unter Linux on Sat, 22 Dec 2007 00:10:30 GMT]]></title><description><![CDATA[<p>Die ist schon ausführbar, sonst würdest du eine Fehlermeldung bezüglich fehlender Rechte oder falschem Binärformat bekommen. Wenn du sie von der Konsole aus startest und es erscheint direkt der nächste Prompt, liegt das daran, dass dein &quot;Hello World&quot; nicht mit einem Newline abgeschlossen ist.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1424672</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1424672</guid><dc:creator><![CDATA[Bashar]]></dc:creator><pubDate>Sat, 22 Dec 2007 00:10:30 GMT</pubDate></item><item><title><![CDATA[Reply to Compilen unter Linux on Sat, 22 Dec 2007 00:35:52 GMT]]></title><description><![CDATA[<p>Passiert leider nichts. Bekomme keine Ausgabe.<br />
Hab jetzt mal was mit Ein &amp; Ausgabe geschrieben, bekomme aber immer noch keine Ausgabe in der Konsole.</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
using namespace std;

int main()

{
	//variablendeklaration
	int zahl1;
	int zahl2;
	int zahl3;

	//eingabe
	cout&lt;&lt;&quot;bitte eine zahl eingeben: &quot;;
	cin&gt;&gt;zahl1;
	cout&lt;&lt;&quot;bitte eine weitere zahl eingeben, welche dazuaddiert wird: &quot;;
	cin&gt;&gt;zahl2;

	//berechnung
	zahl3=zahl1+zahl2;

	//ausgabe
	cout&lt;&lt;&quot;das ergebniss betraegt:&quot;&lt;&lt;zahl3&lt;&lt;endl;

	return(0);
}
</code></pre>
<p>Ausgabe in der Konsole:</p>
<p>markus@m-desktop:~/Desktop/blah$ g++ -o test test.cpp<br />
markus@m-desktop:~/Desktop/blah$ test<br />
markus@m-desktop:~/Desktop/blah$</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1424679</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1424679</guid><dc:creator><![CDATA[**s23**]]></dc:creator><pubDate>Sat, 22 Dec 2007 00:35:52 GMT</pubDate></item><item><title><![CDATA[Reply to Compilen unter Linux on Sat, 22 Dec 2007 00:52:34 GMT]]></title><description><![CDATA[<p>Probier mal ./test aus, dadurch rufst du die Executable im aktuellen Verzeichnis auf.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1424683</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1424683</guid><dc:creator><![CDATA[The-Kenny]]></dc:creator><pubDate>Sat, 22 Dec 2007 00:52:34 GMT</pubDate></item><item><title><![CDATA[Reply to Compilen unter Linux on Sat, 22 Dec 2007 00:59:12 GMT]]></title><description><![CDATA[<p>markus@m-desktop:~/Desktop/blah$ ./test<br />
bitte eine zahl eingeben: 1<br />
bitte eine weitere zahl eingeben, welche dazuaddiert wird: 2<br />
das ergebniss betraegt:3</p>
<p>Vielen Dank, endlich klappts <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/1424685</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1424685</guid><dc:creator><![CDATA[**s23**]]></dc:creator><pubDate>Sat, 22 Dec 2007 00:59:12 GMT</pubDate></item></channel></rss>