<?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[programm läßt sich mit altem gcc nicht übersetzen]]></title><description><![CDATA[<p>Hallo<br />
Ich kann mein Programm mit debian sarge und 3.3.5 ohne Probleme übersetzen.</p>
<p>Nun muss ich aber leider das ganze dringend auf einem debian woody system mit gcc-2.95 übersetzen.</p>
<p>Dabei bekomme ich einige Probleme.</p>
<ol>
<li>mein woody kennt den Befehl nice() nicht. Ist das nicht stdlib ?</li>
</ol>
<pre><code>++ -DHAVE_CONFIG_H -I. -I. -I..     -g -O2 -c -o binaar.o `test -f 'binaar.cpp' || echo './'`binaar.cpp
binaar.cpp: In function `int main(int, char **)':
binaar.cpp:51: implicit declaration of function `int nice(...)'
make[2]: *** [binaar.o] Error 1
</code></pre>
<p>Das kann ich aber noch rausnehmen.</p>
<p>Dann geht es aber los.</p>
<pre><code>g++ -DHAVE_CONFIG_H -I. -I. -I..     -g -O2 -c -o algo.o `test -f 'algo.cpp' || echo './'`algo.cpp
algo.cpp: In method `void Algo::sort()':
algo.cpp:66: no matching function for call to `Algo::sort (TResult *, TResult *, bool (&amp;)(const TResult &amp;, const TResult &amp;))'
algo.cpp:63: candidates are: void Algo::sort()
algo.cpp:67: implicit declaration of function `int unique(...)'
algo.cpp:67: assignment to `TResult *' from `int' lacks a cast
make[2]: *** [algo.o] Error 1
make[2]: Leaving directory `/root/binaar/src'
</code></pre>
<p>Der Code der den Fehler verursacht ist der folgende:</p>
<pre><code class="language-cpp">#include &quot;algo.h&quot;
#include &lt;iostream&gt;

Algo::Algo(const char* path) {
    firstpassdone = false;
    lpath = path;
}

/**
 * This Function returns a result of an algo by given number.
 * if the number is higher then posible or less 0 then the result is null
 * @param number: Number of the result
 * @return TResult
 */
TResult Algo::getResult(uint number) {
    if (number &gt;= 0 &amp;&amp; number &lt; result.size()) {
        return result[number];
    } else {
        TResult tmp;
        tmp.frame = -1;
        return tmp;
    }
}

bool Compare(const TResult &amp;a, const TResult &amp;b) {
    return a.frame &lt; b.frame;
}

bool Unique(const TResult &amp;a, const TResult &amp;b) {
    return a.frame == b.frame;
}

void Algo::sort() {
    if (!result.empty()) {
        std::vector&lt;TResult&gt;::iterator newEnd;
        std::sort(result.begin(),result.end(),Compare);
        newEnd = std::unique(result.begin(),result.end(),Unique);
        result.erase(newEnd, result.end());
    }
}
</code></pre>
<p>(in Bunt <a href="http://phpfi.com/78511" rel="nofollow">http://phpfi.com/78511</a>)</p>
<p>Ich vermute mal das es an den Namespaces liegt.<br />
alte gcc Versionen sollen da etwas eigen sein.<br />
Mehr Infos habe ich dazu jedoch nicht.<br />
Kann mir da jemand einen Tip geben?<br />
Ist leider echt dringend!! BITTE <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f62e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_open_mouth"
      title=":open_mouth:"
      alt="😮"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/topic/120659/programm-läßt-sich-mit-altem-gcc-nicht-übersetzen</link><generator>RSS for Node</generator><lastBuildDate>Sat, 22 Aug 2026 11:37:26 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/120659.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 15 Sep 2005 10:41:28 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to programm läßt sich mit altem gcc nicht übersetzen on Thu, 15 Sep 2005 10:41:28 GMT]]></title><description><![CDATA[<p>Hallo<br />
Ich kann mein Programm mit debian sarge und 3.3.5 ohne Probleme übersetzen.</p>
<p>Nun muss ich aber leider das ganze dringend auf einem debian woody system mit gcc-2.95 übersetzen.</p>
<p>Dabei bekomme ich einige Probleme.</p>
<ol>
<li>mein woody kennt den Befehl nice() nicht. Ist das nicht stdlib ?</li>
</ol>
<pre><code>++ -DHAVE_CONFIG_H -I. -I. -I..     -g -O2 -c -o binaar.o `test -f 'binaar.cpp' || echo './'`binaar.cpp
binaar.cpp: In function `int main(int, char **)':
binaar.cpp:51: implicit declaration of function `int nice(...)'
make[2]: *** [binaar.o] Error 1
</code></pre>
<p>Das kann ich aber noch rausnehmen.</p>
<p>Dann geht es aber los.</p>
<pre><code>g++ -DHAVE_CONFIG_H -I. -I. -I..     -g -O2 -c -o algo.o `test -f 'algo.cpp' || echo './'`algo.cpp
algo.cpp: In method `void Algo::sort()':
algo.cpp:66: no matching function for call to `Algo::sort (TResult *, TResult *, bool (&amp;)(const TResult &amp;, const TResult &amp;))'
algo.cpp:63: candidates are: void Algo::sort()
algo.cpp:67: implicit declaration of function `int unique(...)'
algo.cpp:67: assignment to `TResult *' from `int' lacks a cast
make[2]: *** [algo.o] Error 1
make[2]: Leaving directory `/root/binaar/src'
</code></pre>
<p>Der Code der den Fehler verursacht ist der folgende:</p>
<pre><code class="language-cpp">#include &quot;algo.h&quot;
#include &lt;iostream&gt;

Algo::Algo(const char* path) {
    firstpassdone = false;
    lpath = path;
}

/**
 * This Function returns a result of an algo by given number.
 * if the number is higher then posible or less 0 then the result is null
 * @param number: Number of the result
 * @return TResult
 */
TResult Algo::getResult(uint number) {
    if (number &gt;= 0 &amp;&amp; number &lt; result.size()) {
        return result[number];
    } else {
        TResult tmp;
        tmp.frame = -1;
        return tmp;
    }
}

bool Compare(const TResult &amp;a, const TResult &amp;b) {
    return a.frame &lt; b.frame;
}

bool Unique(const TResult &amp;a, const TResult &amp;b) {
    return a.frame == b.frame;
}

void Algo::sort() {
    if (!result.empty()) {
        std::vector&lt;TResult&gt;::iterator newEnd;
        std::sort(result.begin(),result.end(),Compare);
        newEnd = std::unique(result.begin(),result.end(),Unique);
        result.erase(newEnd, result.end());
    }
}
</code></pre>
<p>(in Bunt <a href="http://phpfi.com/78511" rel="nofollow">http://phpfi.com/78511</a>)</p>
<p>Ich vermute mal das es an den Namespaces liegt.<br />
alte gcc Versionen sollen da etwas eigen sein.<br />
Mehr Infos habe ich dazu jedoch nicht.<br />
Kann mir da jemand einen Tip geben?<br />
Ist leider echt dringend!! BITTE <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f62e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_open_mouth"
      title=":open_mouth:"
      alt="😮"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/872666</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/872666</guid><dc:creator><![CDATA[decembersoul]]></dc:creator><pubDate>Thu, 15 Sep 2005 10:41:28 GMT</pubDate></item><item><title><![CDATA[Reply to programm läßt sich mit altem gcc nicht übersetzen on Thu, 15 Sep 2005 13:30:00 GMT]]></title><description><![CDATA[<p>Hallo,<br />
sieht so aus als hättest du &lt;algorithm&gt; nicht inkludiert.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/872863</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/872863</guid><dc:creator><![CDATA[HumeSikkins]]></dc:creator><pubDate>Thu, 15 Sep 2005 13:30:00 GMT</pubDate></item><item><title><![CDATA[Reply to programm läßt sich mit altem gcc nicht übersetzen on Thu, 15 Sep 2005 15:33:32 GMT]]></title><description><![CDATA[<p>hast recht.<br />
Das war es.<br />
Nur komisch das es mit gcc3 geht.</p>
<p>Naja nun geht es auch unter woody</p>
]]></description><link>https://www.c-plusplus.net/forum/post/872981</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/872981</guid><dc:creator><![CDATA[decembersoul]]></dc:creator><pubDate>Thu, 15 Sep 2005 15:33:32 GMT</pubDate></item></channel></rss>