<?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]]></title><description><![CDATA[<p>Hier stimmt was nicht, aber es kommt keine richtige Fehlermeldung: <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>
<pre><code class="language-cpp">#include &lt;iostream&gt;
using namespace std;

class prime
{
    public:
    prime() {}
    ~prime() {}
    inline bool is_prime(unsigned long &amp;number);
    void search_prime(unsigned long &amp;list_end);

    private:
    bool array_null(const unsigned long *value,unsigned long &amp;temp);

};

bool array_null(const unsigned long *value, unsigned long &amp;temp)
{
    if (value==0)
    {
        return true;
        temp++;
        array_null(++value,temp);
    }
    else
    {
        return false;
    }
}

bool prime::is_prime(unsigned long &amp;number)
{
    for (unsigned long i=2;i&lt;number;i++)
    {
        if ((number % i) == 0) return false;
    }
    return true;
}

void prime::search_prime(unsigned long &amp;list_end)
{
    unsigned long *array=new unsigned long[list_end];
    for (unsigned long i=2;i&lt;list_end;i++)
    {
        array_null(&amp;array[2],i);
        if (is_prime(i))
        {
            for (int j=2;j*i&lt;=list_end;j++)
            {
                array[j*i]=0; //0 = KEINE PRIMZAHL
            }
        }
     }
}

int main()
{
    /*prime test;
    unsigned long a=600011;
    cout &lt;&lt; test.is_prime(a) &lt;&lt; endl;*/

    return 0;
}
</code></pre>
<blockquote>
<p>Compiling: C:\MinGW\Andi\prime.cpp<br />
Linking console executable: C:\MinGW\Andi\prime.exe<br />
C:\MinGW\Andi\prime.o:prime.cpp:(.text+0x164): undefined reference to `prime::array_null(unsigned long const*, unsigned long&amp;)'<br />
collect2: ld returned 1 exit status<br />
Process terminated with status 1 (0 minutes, 0 seconds)<br />
0 errors, 0 warnings</p>
<p>Checking for existence: C:\MinGW\Andi\prime.exe</p>
</blockquote>
<p>Findet von euch jemand den Fehler......den der blöde Compiler nicht anzeigt :(.</p>
<p>MfG<br />
Stromberg</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/194603/undefined-reference</link><generator>RSS for Node</generator><lastBuildDate>Tue, 29 Sep 2026 14:35:05 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/194603.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 08 Oct 2007 20:40:34 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to undefined reference on Mon, 08 Oct 2007 20:40:34 GMT]]></title><description><![CDATA[<p>Hier stimmt was nicht, aber es kommt keine richtige Fehlermeldung: <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>
<pre><code class="language-cpp">#include &lt;iostream&gt;
using namespace std;

class prime
{
    public:
    prime() {}
    ~prime() {}
    inline bool is_prime(unsigned long &amp;number);
    void search_prime(unsigned long &amp;list_end);

    private:
    bool array_null(const unsigned long *value,unsigned long &amp;temp);

};

bool array_null(const unsigned long *value, unsigned long &amp;temp)
{
    if (value==0)
    {
        return true;
        temp++;
        array_null(++value,temp);
    }
    else
    {
        return false;
    }
}

bool prime::is_prime(unsigned long &amp;number)
{
    for (unsigned long i=2;i&lt;number;i++)
    {
        if ((number % i) == 0) return false;
    }
    return true;
}

void prime::search_prime(unsigned long &amp;list_end)
{
    unsigned long *array=new unsigned long[list_end];
    for (unsigned long i=2;i&lt;list_end;i++)
    {
        array_null(&amp;array[2],i);
        if (is_prime(i))
        {
            for (int j=2;j*i&lt;=list_end;j++)
            {
                array[j*i]=0; //0 = KEINE PRIMZAHL
            }
        }
     }
}

int main()
{
    /*prime test;
    unsigned long a=600011;
    cout &lt;&lt; test.is_prime(a) &lt;&lt; endl;*/

    return 0;
}
</code></pre>
<blockquote>
<p>Compiling: C:\MinGW\Andi\prime.cpp<br />
Linking console executable: C:\MinGW\Andi\prime.exe<br />
C:\MinGW\Andi\prime.o:prime.cpp:(.text+0x164): undefined reference to `prime::array_null(unsigned long const*, unsigned long&amp;)'<br />
collect2: ld returned 1 exit status<br />
Process terminated with status 1 (0 minutes, 0 seconds)<br />
0 errors, 0 warnings</p>
<p>Checking for existence: C:\MinGW\Andi\prime.exe</p>
</blockquote>
<p>Findet von euch jemand den Fehler......den der blöde Compiler nicht anzeigt :(.</p>
<p>MfG<br />
Stromberg</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1380835</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1380835</guid><dc:creator><![CDATA[Stromberg]]></dc:creator><pubDate>Mon, 08 Oct 2007 20:40:34 GMT</pubDate></item><item><title><![CDATA[Reply to undefined reference on Mon, 08 Oct 2007 20:42:38 GMT]]></title><description><![CDATA[<p>bool prime::array_null</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1380843</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1380843</guid><dc:creator><![CDATA[elise]]></dc:creator><pubDate>Mon, 08 Oct 2007 20:42:38 GMT</pubDate></item><item><title><![CDATA[Reply to undefined reference on Mon, 08 Oct 2007 20:59:34 GMT]]></title><description><![CDATA[<p>Oh verdammt. --&gt; PEINLICH <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1380858</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1380858</guid><dc:creator><![CDATA[Stromberg]]></dc:creator><pubDate>Mon, 08 Oct 2007 20:59:34 GMT</pubDate></item><item><title><![CDATA[Reply to undefined reference on Tue, 09 Oct 2007 05:02:17 GMT]]></title><description><![CDATA[<p>Stromberg schrieb:</p>
<blockquote>
<p>Oh verdammt. --&gt; PEINLICH <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /></p>
</blockquote>
<p>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>
]]></description><link>https://www.c-plusplus.net/forum/post/1380933</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1380933</guid><dc:creator><![CDATA[elise]]></dc:creator><pubDate>Tue, 09 Oct 2007 05:02:17 GMT</pubDate></item></channel></rss>