<?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[operator&amp;lt;&amp;lt;, ist mir ein raetsel]]></title><description><![CDATA[<p>Hallo,</p>
<p>Leider funktioniert die Suche nicht und in der FAQ hab ich auch nichts gefunden, habe folgendes Problem: ich versuche verzweifelt meinen operator&lt;&lt; zu ueberladen aber bekomme jedes mal folgenden fehler</p>
<p>.net<br />
test.obj : error LNK2019: Nicht aufgelöstes externes Symbol '&quot;class std::basic_ostream&lt;char,struct std::char_traits&lt;char&gt; &gt; &amp; __cdecl my::operator&lt;&lt;(class std::basic_ostream&lt;char,struct std::char_traits&lt;char&gt; &gt; &amp;,class my::String const &amp;)&quot; (??6my@@YAAAV?<span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>b</mi><mi>a</mi><mi>s</mi><mi>i</mi><mi>c</mi><mi mathvariant="normal">_</mi><mi>o</mi><mi>s</mi><mi>t</mi><mi>r</mi><mi>e</mi><mi>a</mi><mi>m</mi><mi mathvariant="normal">@</mi><mi>D</mi><mi>U</mi><mo>?</mo></mrow><annotation encoding="application/x-tex">basic\_ostream@DU?</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="strut" style="height:0.69444em;"></span><span class="strut bottom" style="height:1.00444em;vertical-align:-0.31em;"></span><span class="base textstyle uncramped"><span class="mord mathit">b</span><span class="mord mathit">a</span><span class="mord mathit">s</span><span class="mord mathit">i</span><span class="mord mathit">c</span><span class="mord mathrm" style="margin-right:0.02778em;">_</span><span class="mord mathit">o</span><span class="mord mathit">s</span><span class="mord mathit">t</span><span class="mord mathit" style="margin-right:0.02778em;">r</span><span class="mord mathit">e</span><span class="mord mathit">a</span><span class="mord mathit">m</span><span class="mord mathrm">@</span><span class="mord mathit" style="margin-right:0.02778em;">D</span><span class="mord mathit" style="margin-right:0.10903em;">U</span><span class="mclose">?</span></span></span></span>char_traits@D@std@@@std@@AAV12@ABVString@0@@Z)', verwiesen in Funktion '_main'</p>
<p>mingw<br />
[Linker error] undefined reference to `my::operator&lt;&lt;(std::ostream&amp;, my::String const&amp;)'</p>
<p>(also einen nicht aufgeloesten externen Verweis)</p>
<p>hier mein code:</p>
<pre><code class="language-cpp">// header
#include &lt;iostream&gt;

using namespace std;

namespace ParserUtilities
{
	class String
        {
	public:		
		//
		friend ostream&amp; operator&lt;&lt; (ostream&amp;, const String&amp;);
		friend istream&amp; operator&gt;&gt; (istream&amp;, String&amp;);
        };
        //
};

//cpp
#include &quot;utilities.h&quot;

using namespace ParserUtilities;

//
ostream&amp; operator&lt;&lt; (ostream&amp; os, const String&amp; s)
{
	os &lt;&lt; s.c_str();
	return os;
}
</code></pre>
<p>bitte helft mir bin echt schon am verzweifeln hab schon alles versucht, außerhalb der Klasse alle moeglichen Namensraeume usw.. <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="😞"
    /> <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>mfg leo</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/129430/operator-lt-lt-ist-mir-ein-raetsel</link><generator>RSS for Node</generator><lastBuildDate>Wed, 26 Aug 2026 04:56:34 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/129430.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 13 Dec 2005 16:15:23 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to operator&amp;lt;&amp;lt;, ist mir ein raetsel on Tue, 13 Dec 2005 16:15:23 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>Leider funktioniert die Suche nicht und in der FAQ hab ich auch nichts gefunden, habe folgendes Problem: ich versuche verzweifelt meinen operator&lt;&lt; zu ueberladen aber bekomme jedes mal folgenden fehler</p>
<p>.net<br />
test.obj : error LNK2019: Nicht aufgelöstes externes Symbol '&quot;class std::basic_ostream&lt;char,struct std::char_traits&lt;char&gt; &gt; &amp; __cdecl my::operator&lt;&lt;(class std::basic_ostream&lt;char,struct std::char_traits&lt;char&gt; &gt; &amp;,class my::String const &amp;)&quot; (??6my@@YAAAV?<span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>b</mi><mi>a</mi><mi>s</mi><mi>i</mi><mi>c</mi><mi mathvariant="normal">_</mi><mi>o</mi><mi>s</mi><mi>t</mi><mi>r</mi><mi>e</mi><mi>a</mi><mi>m</mi><mi mathvariant="normal">@</mi><mi>D</mi><mi>U</mi><mo>?</mo></mrow><annotation encoding="application/x-tex">basic\_ostream@DU?</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="strut" style="height:0.69444em;"></span><span class="strut bottom" style="height:1.00444em;vertical-align:-0.31em;"></span><span class="base textstyle uncramped"><span class="mord mathit">b</span><span class="mord mathit">a</span><span class="mord mathit">s</span><span class="mord mathit">i</span><span class="mord mathit">c</span><span class="mord mathrm" style="margin-right:0.02778em;">_</span><span class="mord mathit">o</span><span class="mord mathit">s</span><span class="mord mathit">t</span><span class="mord mathit" style="margin-right:0.02778em;">r</span><span class="mord mathit">e</span><span class="mord mathit">a</span><span class="mord mathit">m</span><span class="mord mathrm">@</span><span class="mord mathit" style="margin-right:0.02778em;">D</span><span class="mord mathit" style="margin-right:0.10903em;">U</span><span class="mclose">?</span></span></span></span>char_traits@D@std@@@std@@AAV12@ABVString@0@@Z)', verwiesen in Funktion '_main'</p>
<p>mingw<br />
[Linker error] undefined reference to `my::operator&lt;&lt;(std::ostream&amp;, my::String const&amp;)'</p>
<p>(also einen nicht aufgeloesten externen Verweis)</p>
<p>hier mein code:</p>
<pre><code class="language-cpp">// header
#include &lt;iostream&gt;

using namespace std;

namespace ParserUtilities
{
	class String
        {
	public:		
		//
		friend ostream&amp; operator&lt;&lt; (ostream&amp;, const String&amp;);
		friend istream&amp; operator&gt;&gt; (istream&amp;, String&amp;);
        };
        //
};

//cpp
#include &quot;utilities.h&quot;

using namespace ParserUtilities;

//
ostream&amp; operator&lt;&lt; (ostream&amp; os, const String&amp; s)
{
	os &lt;&lt; s.c_str();
	return os;
}
</code></pre>
<p>bitte helft mir bin echt schon am verzweifeln hab schon alles versucht, außerhalb der Klasse alle moeglichen Namensraeume usw.. <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="😞"
    /> <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>mfg leo</p>
]]></description><link>https://www.c-plusplus.net/forum/post/941196</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/941196</guid><dc:creator><![CDATA[leo aka qsch]]></dc:creator><pubDate>Tue, 13 Dec 2005 16:15:23 GMT</pubDate></item><item><title><![CDATA[Reply to operator&amp;lt;&amp;lt;, ist mir ein raetsel on Tue, 13 Dec 2005 16:21:07 GMT]]></title><description><![CDATA[<p>Mit &quot;using namespace ...&quot; wird dieser namespace in den globalen Namespace eingebunden. Aber du wirst deswegen noch nicht in diesen versetzt.</p>
<p>Heißt für dich:</p>
<pre><code class="language-cpp">ostream&amp; ParserUtilities::operator&lt;&lt; (ostream&amp; os, const String&amp; s)
{
    os &lt;&lt; s.c_str();
    return os;
}

// bzw.
namespace ParserUtilities
{
    ostream&amp; operator&lt;&lt; (ostream&amp; os, const String&amp; s)
    {
        os &lt;&lt; s.c_str();
        return os;
    }
}
</code></pre>
<p>MfG SideWinder</p>
]]></description><link>https://www.c-plusplus.net/forum/post/941199</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/941199</guid><dc:creator><![CDATA[SideWinder]]></dc:creator><pubDate>Tue, 13 Dec 2005 16:21:07 GMT</pubDate></item></channel></rss>