<?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[undefined reference Problem]]></title><description><![CDATA[<p>Hallo,</p>
<p>wenn ich folgenden Code (den vollständigen) kompiliere</p>
<p>class feld {<br />
...</p>
<p>static constexpr std::array&lt;int, farbe::Nb&gt; RankMask = { {0, 0xF} };<br />
....<br />
feld();</p>
<p>//---------------------------------------------------<br />
public:<br />
...<br />
static int pawn_rank(const int feld, const int farbe) {<br />
return rank(feld) ^ RankMask[farbe];<br />
};<br />
...<br />
};</p>
<p>erhalte ich die Fehlermeldung: undefined reference to `feld::RankMask'</p>
<p>Scheinbar vermisst er eine Definition der Variablen RankMask, aber weshalb ?<br />
und wie und wo kann ich sie einfügen. Vielen Dank !</p>
<p>Gruß</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/317858/undefined-reference-problem</link><generator>RSS for Node</generator><lastBuildDate>Mon, 27 Jul 2026 21:47:11 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/317858.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 22 Jun 2013 19:09:17 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to undefined reference Problem on Sat, 22 Jun 2013 19:09:17 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>wenn ich folgenden Code (den vollständigen) kompiliere</p>
<p>class feld {<br />
...</p>
<p>static constexpr std::array&lt;int, farbe::Nb&gt; RankMask = { {0, 0xF} };<br />
....<br />
feld();</p>
<p>//---------------------------------------------------<br />
public:<br />
...<br />
static int pawn_rank(const int feld, const int farbe) {<br />
return rank(feld) ^ RankMask[farbe];<br />
};<br />
...<br />
};</p>
<p>erhalte ich die Fehlermeldung: undefined reference to `feld::RankMask'</p>
<p>Scheinbar vermisst er eine Definition der Variablen RankMask, aber weshalb ?<br />
und wie und wo kann ich sie einfügen. Vielen Dank !</p>
<p>Gruß</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2333396</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2333396</guid><dc:creator><![CDATA[hgr52]]></dc:creator><pubDate>Sat, 22 Jun 2013 19:09:17 GMT</pubDate></item><item><title><![CDATA[Reply to undefined reference Problem on Sun, 23 Jun 2013 10:14:15 GMT]]></title><description><![CDATA[<p>hgr52 schrieb:</p>
<blockquote>
<p>Scheinbar vermisst er eine Definition der Variablen RankMask, aber weshalb ?</p>
</blockquote>
<p>Weil keine da ist <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="🙂"
    /> . Du hast RankMask nur deklariert.</p>
<blockquote>
<p>und wie und wo kann ich sie einfügen.</p>
</blockquote>
<p>In einer Quellcodedatei (kein Header):</p>
<pre><code>constexpr std::array&lt;int, farbe::Nb&gt; feld::RankMask;
</code></pre>
<p>P.S.: Falls du dich wunderst, ob das was mit constexpr, array, in-class initializern oder sonstigem aus C++11 zu tun hat: Hat es nicht. Das ist ganz normal bei statischen Membern und war schon immer so.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2333482</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2333482</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Sun, 23 Jun 2013 10:14:15 GMT</pubDate></item><item><title><![CDATA[Reply to undefined reference Problem on Sun, 23 Jun 2013 10:39:46 GMT]]></title><description><![CDATA[<p>Problem gelöst, 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="🙂"
    /></p>
<p>Mit Deinem Hinweis auf c++11 hast Du auch ins Schwarze getoffen. Hatte da wohl etwas nicht verstanden und die Definitionen aus der.cpp entfernt.<br />
Nochmals Danke</p>
<p>Gruß</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2333491</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2333491</guid><dc:creator><![CDATA[hgr52]]></dc:creator><pubDate>Sun, 23 Jun 2013 10:39:46 GMT</pubDate></item></channel></rss>