<?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[[Solved] Linkerfehler (ehem. Typkonvertierung?)]]></title><description><![CDATA[<p>Ich habe mir eine Klasse TExec geschrieben, die einen ausfuehrbaren Befehl repraesentieren soll, ausserdem habe ich eine Spezialisierung als Template geschrieben, die die std::binary_function templates wrappern soll:</p>
<pre><code class="language-cpp">#include &quot;TPrimitive.hpp&quot;

#include &lt;vector&gt;

class TExec
{
public:
  virtual void operator() (TPrimitive&amp; result, std::vector&lt;TPrimitive*&gt; arglist) const;
  virtual ~TExec();
};

template&lt;class Func&gt; class TBinaryExec : public TExec
{
public:
  void operator() (TPrimitive&amp; result, std::vector&lt;TPrimitive*&gt; arglist) const
    {
      Func binfct;
      result = binfct(*arglist[0], *arglist[1]);
      return;
    };
  ~TBinaryExec() {};

};
</code></pre>
<p>Nun versuche ich in meinem Testprogramm eine Instanz zu erstellen:</p>
<pre><code class="language-cpp">#include &quot;TExec.hpp&quot;&quot;
#include &lt;functional&gt;

int main()
{
  TInt a = 5;
  TInt b = 6;
  TInt c;

  TBinaryExec&lt;std::plus&lt;TInt&gt; &gt; exec;
};
</code></pre>
<p>TInt ist dabei eine von TPrimitive abgeleitete Klasse. Nun schmeisst mir der Compiler das (wohl zu Recht) mit folgendem Kommentar um die Ohren:</p>
<pre><code>TExec.hpp: In member function `void TBinaryExec&lt;Func&gt;::operator()(TPrimitive&amp;,
   std::vector&lt;TPrimitive*, std::allocator&lt;TPrimitive*&gt; &gt;) const [with Func =
   std::plus&lt;TInt&gt;]':
/opt/products/gcc/3.3.3/include/g++-3/bits/stl_map.h:120:   instantiated from here
TExec.hpp:22: error: no match for call to `(std::plus&lt;TInt&gt;) (TPrimitive&amp;,
   TPrimitive&amp;)'
/opt/products/gcc/3.3.3/include/g++-3/bits/stl_function.h:129: error: candidates
   are: _Tp std::plus&lt;_Tp&gt;::operator()(const _Tp&amp;, const _Tp&amp;) const [with _Tp
   = TInt]
</code></pre>
<p>Wie krieg ich das nu geloest, dass es in diesem und aehnlichen Faellen klappt? Muss ich tatsaechlich expizite Typkonvertierung bemuehen, oder einfach std::plus&lt;TPrimitive&gt; benutzen? (TInt hat den operator+ definiert, TPrimitive hingegen nicht, und ich vermute mal dass std::plus&lt;&gt; den benutzen moechte...)</p>
<p>/edit: std::plus&lt;TPrimitive&gt; wird mir um die Ohren geschmissen, da kein TPrimitive::operator+ existiert, wie befuerchtet.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/181878/solved-linkerfehler-ehem-typkonvertierung</link><generator>RSS for Node</generator><lastBuildDate>Tue, 22 Sep 2026 12:13:48 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/181878.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 18 May 2007 13:08:17 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to [Solved] Linkerfehler (ehem. Typkonvertierung?) on Mon, 21 May 2007 13:28:45 GMT]]></title><description><![CDATA[<p>Ich habe mir eine Klasse TExec geschrieben, die einen ausfuehrbaren Befehl repraesentieren soll, ausserdem habe ich eine Spezialisierung als Template geschrieben, die die std::binary_function templates wrappern soll:</p>
<pre><code class="language-cpp">#include &quot;TPrimitive.hpp&quot;

#include &lt;vector&gt;

class TExec
{
public:
  virtual void operator() (TPrimitive&amp; result, std::vector&lt;TPrimitive*&gt; arglist) const;
  virtual ~TExec();
};

template&lt;class Func&gt; class TBinaryExec : public TExec
{
public:
  void operator() (TPrimitive&amp; result, std::vector&lt;TPrimitive*&gt; arglist) const
    {
      Func binfct;
      result = binfct(*arglist[0], *arglist[1]);
      return;
    };
  ~TBinaryExec() {};

};
</code></pre>
<p>Nun versuche ich in meinem Testprogramm eine Instanz zu erstellen:</p>
<pre><code class="language-cpp">#include &quot;TExec.hpp&quot;&quot;
#include &lt;functional&gt;

int main()
{
  TInt a = 5;
  TInt b = 6;
  TInt c;

  TBinaryExec&lt;std::plus&lt;TInt&gt; &gt; exec;
};
</code></pre>
<p>TInt ist dabei eine von TPrimitive abgeleitete Klasse. Nun schmeisst mir der Compiler das (wohl zu Recht) mit folgendem Kommentar um die Ohren:</p>
<pre><code>TExec.hpp: In member function `void TBinaryExec&lt;Func&gt;::operator()(TPrimitive&amp;,
   std::vector&lt;TPrimitive*, std::allocator&lt;TPrimitive*&gt; &gt;) const [with Func =
   std::plus&lt;TInt&gt;]':
/opt/products/gcc/3.3.3/include/g++-3/bits/stl_map.h:120:   instantiated from here
TExec.hpp:22: error: no match for call to `(std::plus&lt;TInt&gt;) (TPrimitive&amp;,
   TPrimitive&amp;)'
/opt/products/gcc/3.3.3/include/g++-3/bits/stl_function.h:129: error: candidates
   are: _Tp std::plus&lt;_Tp&gt;::operator()(const _Tp&amp;, const _Tp&amp;) const [with _Tp
   = TInt]
</code></pre>
<p>Wie krieg ich das nu geloest, dass es in diesem und aehnlichen Faellen klappt? Muss ich tatsaechlich expizite Typkonvertierung bemuehen, oder einfach std::plus&lt;TPrimitive&gt; benutzen? (TInt hat den operator+ definiert, TPrimitive hingegen nicht, und ich vermute mal dass std::plus&lt;&gt; den benutzen moechte...)</p>
<p>/edit: std::plus&lt;TPrimitive&gt; wird mir um die Ohren geschmissen, da kein TPrimitive::operator+ existiert, wie befuerchtet.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1287390</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1287390</guid><dc:creator><![CDATA[pumuckl]]></dc:creator><pubDate>Mon, 21 May 2007 13:28:45 GMT</pubDate></item><item><title><![CDATA[Reply to [Solved] Linkerfehler (ehem. Typkonvertierung?) on Fri, 18 May 2007 13:37:29 GMT]]></title><description><![CDATA[<p>ich habs jetzt so &quot;geloest&quot;:</p>
<pre><code class="language-cpp">// TExec.hpp
template&lt;class Func, class T&gt; class TBinaryExec : public TExec
{
public:
  void operator() (TPrimitive&amp; result, std::vector&lt;TPrimitive*&gt; arglist) const
    {
      Func binfct;
      result = binfct(*dynamic_cast&lt;T*&gt;(arglist[0]), *dynamic_cast&lt;T*&gt;(arglist[1]));
      return;
    };
  ~TBinaryExec() {};

};

//main()
int main()
{
  TInt a = 5;
  TInt b = 6;
  TInt c;

  TBinaryExec&lt;std::plus&lt;TInt&gt;, TInt&gt; exec;

  std::vector&lt;TPrimitive*&gt; arglist;
  arglist.push_back(&amp;a);
  arglist.push_back(&amp;b);

  exec(c, arglist);
};
</code></pre>
<p>Compilieren tut ers auch ohne groessere probleme, nur beim Linken schmeisst er mir zig Zeilen Quark um die Ohren asu dem ich so garnicht schlau werde:</p>
<pre><code>testprg.o(.gnu.linkonce.t._ZN11TBinaryExecISt4plusI4TIntES1_ED1Ev+0x16): In function `TBinaryExec&lt;std::plus&lt;TInt&gt;, TInt&gt;::~TBinaryExec [in-charge]()':
: undefined reference to `TExec::~TExec [not-in-charge]()'
testprg.o(.gnu.linkonce.t._ZN11TBinaryExecISt4plusI4TIntES1_ED1Ev+0x2d): In function `TBinaryExec&lt;std::plus&lt;TInt&gt;, TInt&gt;::~TBinaryExec [in-charge]()':
: undefined reference to `operator delete(void*)'
testprg.o(.gnu.linkonce.t._ZN4TIntD1Ev+0x16): In function `TInt::~TInt [in-charge]()':
: undefined reference to `TPrimitive::~TPrimitive [not-in-charge]()'
testprg.o(.gnu.linkonce.t._ZN4TIntD1Ev+0x2d): In function `TInt::~TInt [in-charge]()':
: undefined reference to `operator delete(void*)'
testprg.o(.gnu.linkonce.t._ZNK11TBinaryExecISt4plusI4TIntES1_EclER10TPrimitiveSt6vectorIPS4_SaIS7_EE+0x3e): In function `TBinaryExec&lt;std::plus&lt;TInt&gt;, TInt&gt;::operator()(TPrimitive&amp;, std::vector&lt;TPrimitive*, std::allocator&lt;TPrimitive*&gt; &gt;) const':
: undefined reference to `typeinfo for TPrimitive'
testprg.o(.gnu.linkonce.t._ZNK11TBinaryExecISt4plusI4TIntES1_EclER10TPrimitiveSt6vectorIPS4_SaIS7_EE+0x49): In function `TBinaryExec&lt;std::plus&lt;TInt&gt;, TInt&gt;::operator()(TPrimitive&amp;, std::vector&lt;TPrimitive*, std::allocator&lt;TPrimitive*&gt; &gt;) const':
: undefined reference to `__dynamic_cast'
testprg.o(.gnu.linkonce.t._ZNK11TBinaryExecISt4plusI4TIntES1_EclER10TPrimitiveSt6vectorIPS4_SaIS7_EE+0x8b): In function `TBinaryExec&lt;std::plus&lt;TInt&gt;, TInt&gt;::operator()(TPrimitive&amp;, std::vector&lt;TPrimitive*, std::allocator&lt;TPrimitive*&gt; &gt;) const':
: undefined reference to `typeinfo for TPrimitive'
testprg.o(.gnu.linkonce.t._ZNK11TBinaryExecISt4plusI4TIntES1_EclER10TPrimitiveSt6vectorIPS4_SaIS7_EE+0x96): In function `TBinaryExec&lt;std::plus&lt;TInt&gt;, TInt&gt;::operator()(TPrimitive&amp;, std::vector&lt;TPrimitive*, std::allocator&lt;TPrimitive*&gt; &gt;) const':
: undefined reference to `__dynamic_cast'
testprg.o(.gnu.linkonce.t._ZN11TBinaryExecISt4plusI4TIntES1_ED0Ev+0x16): In function `TBinaryExec&lt;std::plus&lt;TInt&gt;, TInt&gt;::~TBinaryExec [in-charge deleting]()':
: undefined reference to `TExec::~TExec [not-in-charge]()'
testprg.o(.gnu.linkonce.t._ZN11TBinaryExecISt4plusI4TIntES1_ED0Ev+0x2d): In function `TBinaryExec&lt;std::plus&lt;TInt&gt;, TInt&gt;::~TBinaryExec [in-charge deleting]()':
: undefined reference to `operator delete(void*)'
testprg.o(.gnu.linkonce.t._ZNSt14__simple_allocIP10TPrimitiveSt24__default_alloc_templateILb1ELi0EEE10deallocateEPS1_j+0x1d): In function `std::__simple_alloc&lt;TPrimitive*, std::__default_alloc_template&lt;(bool)1, (int)0&gt; &gt;::deallocate(TPrimitive**, unsigned)':
: undefined reference to `std::__default_alloc_template&lt;(bool)1, (int)0&gt;::deallocate(void*, unsigned)'
testprg.o(.gnu.linkonce.r._ZTI11TBinaryExecISt4plusI4TIntES1_E+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
testprg.o(.gnu.linkonce.r._ZTI11TBinaryExecISt4plusI4TIntES1_E+0x8): undefined reference to `typeinfo for TExec'
testprg.o(.gnu.linkonce.t._ZN10TPrimitiveC2Ev+0x8): In function `TPrimitive::TPrimitive[not-in-charge]()':
: undefined reference to `vtable for TPrimitive'
testprg.o(.gnu.linkonce.t._ZN4TIntD0Ev+0x16): In function `TInt::~TInt [in-charge deleting]()':
: undefined reference to `TPrimitive::~TPrimitive [not-in-charge]()'
testprg.o(.gnu.linkonce.t._ZN4TIntD0Ev+0x2d): In function `TInt::~TInt [in-charge deleting]()':
: undefined reference to `operator delete(void*)'
testprg.o(.gnu.linkonce.t._ZN4TInt3isAEv+0xe): In function `TInt::isA()':
: undefined reference to `std::allocator&lt;char&gt;::allocator[in-charge]()'
testprg.o(.gnu.linkonce.t._ZN4TInt3isAEv+0x28): In function `TInt::isA()':
: undefined reference to `std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;::basic_string[in-charge](char const*, std::allocator&lt;char&gt; const&amp;)'
testprg.o(.gnu.linkonce.t._ZN4TInt3isAEv+0x33): In function `TInt::isA()':
: undefined reference to `std::allocator&lt;char&gt;::~allocator [in-charge]()'
testprg.o(.gnu.linkonce.t._ZN4TInt3isAEv+0x46): In function `TInt::isA()':
: undefined reference to `std::allocator&lt;char&gt;::~allocator [in-charge]()'
testprg.o(.gnu.linkonce.t._ZN5TExecC2Ev+0x8): In function `TExec::TExec[not-in-charge]()':
: undefined reference to `vtable for TExec'
testprg.o(.gnu.linkonce.t._ZNSt14__simple_allocIP10TPrimitiveSt24__default_alloc_templateILb1ELi0EEE8allocateEj+0x1d): In function `std::__simple_alloc&lt;TPrimitive*, std::__default_alloc_template&lt;(bool)1, (int)0&gt; &gt;::allocate(unsigned)':
: undefined reference to `std::__default_alloc_template&lt;(bool)1, (int)0&gt;::allocate(unsigned)'
testprg.o(.gnu.linkonce.r._ZTI4TInt+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
testprg.o(.gnu.linkonce.r._ZTI4TInt+0x8): undefined reference to `typeinfo for TPrimitive'
testprg.o(.eh_frame+0x12): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1287400</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1287400</guid><dc:creator><![CDATA[pumuckl]]></dc:creator><pubDate>Fri, 18 May 2007 13:37:29 GMT</pubDate></item><item><title><![CDATA[Reply to [Solved] Linkerfehler (ehem. Typkonvertierung?) on Fri, 18 May 2007 15:39:21 GMT]]></title><description><![CDATA[<p>Eine Lösung wäre es, schon die Basisklasse als Template anzulegen (d.h. sie verwendet nicht mehr den vorgegebenen TPrimitive, sondern den jeweils gültigen Argumenttyp als Parameter.</p>
<p>Zu den Linkerfehlern: Du hast zwar den Destruktor und operator() in der TExec deklariert, aber offenbar hast du die zugehörigen Definitionen vergessen (den Operator könntest du noch pur virtuell definieren, aber den Destruktor brauchst du auf jeden Fall).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1287507</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1287507</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Fri, 18 May 2007 15:39:21 GMT</pubDate></item><item><title><![CDATA[Reply to [Solved] Linkerfehler (ehem. Typkonvertierung?) on Sat, 19 May 2007 21:44:21 GMT]]></title><description><![CDATA[<p>Das Problem an der Sache ist, dass ich Pointer auf mehrere Ableitungen von TExec in einem Container lagern will und den operator() der entsprechenden Objekte auf die angegebene Art und Weise aufrufen will, ohne vorher genau zu wissen, welche Ableitungen von TPrimitive dabei genau zum Tragen kommen. Deshalb kann ich TExec nicht als Templateklasse definieren, zumal da eh auch gemischte Parameterlisten für operator() zulässig sein sollen, also z.B.</p>
<pre><code class="language-cpp">class TInt : public TPrimitive;
class TFloat : public TPrimitive;
class MixedArgs : public TExec;

TInt a;
TFloat b;
TFloat c;

std::vector&lt;TPrimitive*&gt; arglist;
arglist.push_back(&amp;a);
arglist.push_back(&amp;b);

MixedArgs myexec;
myexec(c, arglist);
</code></pre>
<p>Was die Linkerfehler angeht: die Definition der Destruktoren hatte ich tatsächlich übersehn, aber auch nachdem ich die nachgeliefert habe meckert er über &quot;undefined reference to 'operator delete(void*)'&quot; - was mir nicht mehr so ganz einleuchtet.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1288214</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1288214</guid><dc:creator><![CDATA[pumuckl]]></dc:creator><pubDate>Sat, 19 May 2007 21:44:21 GMT</pubDate></item><item><title><![CDATA[Reply to [Solved] Linkerfehler (ehem. Typkonvertierung?) on Sun, 20 May 2007 02:21:11 GMT]]></title><description><![CDATA[<p>Warum er operator delete nicht findet weiss ich nicht.<br />
Aber: dynamic_cast bringt dir so wie du das verwendest garnix, denn dynamic_cast mit Zeigern liefert einfach einen null pointer zurück (wenn die Konvertierung nicht möglich ist bzw. nicht erlaubt ist), wodurch dein Programm an der Stelle schön abschmieren wird. Kannst du gleich static_cast verwenden.<br />
Oder aber du verwendest dynamic_cast mit Referenzen (dann fliegt ne Exception wenn die Konvertierung nicht hinhaut), oder du solltest den Returnwert vorher prüfen (wenn du dynamic_cast mit Zeigern verwenden willst).<br />
z.B.:</p>
<pre><code class="language-cpp">//  result = binfct(*dynamic_cast&lt;T*&gt;(arglist[0]), *dynamic_cast&lt;T*&gt;(arglist[1]));
    // -&gt;
    result = binfct(dynamic_cast&lt;T&amp;&gt;(*arglist[0]), dynamic_cast&lt;T&amp;&gt;(*arglist[1]));
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1288273</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1288273</guid><dc:creator><![CDATA[hustbaer]]></dc:creator><pubDate>Sun, 20 May 2007 02:21:11 GMT</pubDate></item><item><title><![CDATA[Reply to [Solved] Linkerfehler (ehem. Typkonvertierung?) on Mon, 21 May 2007 06:50:57 GMT]]></title><description><![CDATA[<p>Okay, danke. dann muss ich mir die genauere Verwendung der cast-Operatoren nochmal anschauen - vielleicht gibt sich das mit dem delete(void*) dann auch von alleine <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1288825</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1288825</guid><dc:creator><![CDATA[pumuckl]]></dc:creator><pubDate>Mon, 21 May 2007 06:50:57 GMT</pubDate></item><item><title><![CDATA[Reply to [Solved] Linkerfehler (ehem. Typkonvertierung?) on Mon, 21 May 2007 10:33:17 GMT]]></title><description><![CDATA[<p>Ich habs jetzt auf static_cast umgestellt und noch einen kleinen Fehler entdeckt - die Fehlermeldungen sind aber leider noch vorhanden:</p>
<pre><code class="language-cpp">//TPrimitive.hpp

class TInt : public TPrimitive
{
private:
  long int _i;
public:
  // Ctor
  TInt() : _i(0) {};
  TInt(const TInt&amp; ti) : _i(ti._i) {};
  TInt(const long int i) : _i(i) {};
  // Dtor
  ~TInt() {};

  // Operators
  TInt&amp; operator= (const long int&amp; i) 
  { _i = i; return *this;};
  TInt&amp; operator= (const TInt&amp; ti)
  { _i = ti._i; return *this;};
  std::ostream&amp; operator&lt;&lt;(std::ostream&amp; os)
  {os &lt;&lt; _i; return os;};
  TInt operator+ (const TInt&amp; ti2) const
  {return TInt(_i+ti2._i);};

  inline const Classname isA() const
  {return &quot;TInt&quot;;};

};

//TExec.hpp

class TExec
{
public:
  virtual void operator() (TPrimitive&amp; result, std::vector&lt;TPrimitive*&gt; arglist) const;
  virtual ~TExec() {};
};

template&lt;class Func, class T&gt; class TBinaryExec : public TExec
{
public:
  virtual void operator() (TPrimitive&amp; result, std::vector&lt;TPrimitive*&gt; arglist) const
    {
      Func binfct;
      T&amp; res = static_cast&lt;T&amp;&gt;(result);
      res = binfct(static_cast&lt;T&amp;&gt;(*arglist[0]), static_cast&lt;T&amp;&gt;(*arglist[1]));
      return;
    };
  ~TBinaryExec() {};

};

//main()

int main()
{
  TInt a = 5;
  TInt b = 6;
  TInt c;

  TBinaryExec&lt;std::plus&lt;TInt&gt;, TInt&gt; exec;

  std::vector&lt;TPrimitive*&gt; arglist;
  arglist.push_back(&amp;a);
  arglist.push_back(&amp;b);

  exec(c, arglist);
};
</code></pre>
<p>ergibt</p>
<pre><code>testprg.o(.gnu.linkonce.t._ZN11TBinaryExecISt4plusI4TIntES1_ED1Ev+0x2d): In function `TBinaryExec&lt;std::plus&lt;TInt&gt;, TInt&gt;::~TBinaryExec [in-charge]()':
: undefined reference to `operator delete(void*)'
testprg.o(.gnu.linkonce.t._ZN4TIntD1Ev+0x2d): In function `TInt::~TInt [in-charge]()':
: undefined reference to `operator delete(void*)'
testprg.o(.gnu.linkonce.t._ZN5TExecD2Ev+0xb): In function `TExec::~TExec [not-in-charge]()':
: undefined reference to `vtable for TExec'
testprg.o(.gnu.linkonce.t._ZN5TExecD2Ev+0x22): In function `TExec::~TExec [not-in-charge]()':
: undefined reference to `operator delete(void*)'
testprg.o(.gnu.linkonce.t._ZN11TBinaryExecISt4plusI4TIntES1_ED0Ev+0x2d): In function `TBinaryExec&lt;std::plus&lt;TInt&gt;, TInt&gt;::~TBinaryExec [in-charge deleting]()':
: undefined reference to `operator delete(void*)'
</code></pre>
<p>usw.</p>
<p>WAS WILL DER VON MIR??? *verzweifelt*</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1288960</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1288960</guid><dc:creator><![CDATA[pumuckl]]></dc:creator><pubDate>Mon, 21 May 2007 10:33:17 GMT</pubDate></item><item><title><![CDATA[Reply to [Solved] Linkerfehler (ehem. Typkonvertierung?) on Mon, 21 May 2007 11:04:45 GMT]]></title><description><![CDATA[<p>Was er mit den &quot;operator delete&quot;s will, ist mir auch nicht klar. Verwendest du vielleicht etwas weiter oben in der Hierarchie new/delete?</p>
<p>Die &quot;: undefined reference to `vtable for TExec'&quot; hängt vermutlich damit zusammen, daß du den TExec::operator() nicht definiert hast. Der Compiler legt dir implizit eine VTable an (um später die virtuellen Methodenaufrufe aufdröseln zu können), allerdings muß er dazu wissen, in welcher Übersetzungseinheit er sie unterbringen soll. Die übliche Lösung dazu ist, sie in der gleichen ÜE zu definieren wie die erste virtuelle Methode der Klasse - und genau die hast du weggelassen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1288980</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1288980</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Mon, 21 May 2007 11:04:45 GMT</pubDate></item><item><title><![CDATA[Reply to [Solved] Linkerfehler (ehem. Typkonvertierung?) on Mon, 21 May 2007 12:45:12 GMT]]></title><description><![CDATA[<p>CStoll schrieb:</p>
<blockquote>
<p>Was er mit den &quot;operator delete&quot;s will, ist mir auch nicht klar. Verwendest du vielleicht etwas weiter oben in der Hierarchie new/delete?</p>
</blockquote>
<p>Kurze Antwort: nein. Der einzige Teil der KLassenhierarchie, den ich nicht mitgeliefert habe, ist eine zweizeilige klassendefinition von TPrimitive sowie ein oder zwei typedefs (Classname ist nichts weiter als std::string)</p>
<pre><code class="language-cpp">class TPrimitive
{
public:
  virtual const Classname isA() const;
  virtual ~TPrimitive() {};
};
</code></pre>
<p>CStoll schrieb:</p>
<blockquote>
<p>Die &quot;: undefined reference to `vtable for TExec'&quot; hängt vermutlich damit zusammen, daß du den TExec::operator() nicht definiert hast. Der Compiler legt dir implizit eine VTable an (um später die virtuellen Methodenaufrufe aufdröseln zu können), allerdings muß er dazu wissen, in welcher Übersetzungseinheit er sie unterbringen soll. Die übliche Lösung dazu ist, sie in der gleichen ÜE zu definieren wie die erste virtuelle Methode der Klasse - und genau die hast du weggelassen.</p>
</blockquote>
<p>Hatte mal gelesen dass es sowas wie &quot;pure virtual&quot; Methoden gibt -&gt; man kann Methoden als virtuell deklarieren, muss sie aber erst in den abgeleiteten KLassen definieren, wenn man die Basisklasse nicht direkt verwendet. War das eine Fehlinformation? Werd mich mal dranmachen, die fehlenden Konstruktoren (an denen es nicht liegen kann) und die fehlenden Definitionen der virtuellen Methoden und Operatoren (an denen es genauso wenig liegen wird?) hinzuferkeln...</p>
<p>ps: mein Compiler ist der gcc 3.3.3 fuer i686-pc-linux-gnu, vielleicht ist da was bekannt in der RIchtung? (glaube ich aber eigentlich nicht)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1289033</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1289033</guid><dc:creator><![CDATA[pumuckl]]></dc:creator><pubDate>Mon, 21 May 2007 12:45:12 GMT</pubDate></item><item><title><![CDATA[Reply to [Solved] Linkerfehler (ehem. Typkonvertierung?) on Mon, 21 May 2007 12:51:56 GMT]]></title><description><![CDATA[<p>Wäre es möglich das du TPrimitive auch mal postest ?<br />
Edit: Danke <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1289036</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1289036</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Mon, 21 May 2007 12:51:56 GMT</pubDate></item><item><title><![CDATA[Reply to [Solved] Linkerfehler (ehem. Typkonvertierung?) on Mon, 21 May 2007 12:51:21 GMT]]></title><description><![CDATA[<p>pumuckl schrieb:</p>
<blockquote>
<p>Hatte mal gelesen dass es sowas wie &quot;pure virtual&quot; Methoden gibt -&gt; man kann Methoden als virtuell deklarieren, muss sie aber erst in den abgeleiteten KLassen definieren, wenn man die Basisklasse nicht direkt verwendet.</p>
</blockquote>
<p>Ne ist schon so eigentlich richtig. Deine op's() in TExec und TPrimitive schreien schon danach pure virtual zu sein:</p>
<pre><code class="language-cpp">virtual const Classname isA() const = 0;
//...
virtual void operator() (TPrimitive&amp; result, std::vector&lt;TPrimitive*&gt; arglist) const = 0;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1289041</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1289041</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Mon, 21 May 2007 12:51:21 GMT</pubDate></item><item><title><![CDATA[Reply to [Solved] Linkerfehler (ehem. Typkonvertierung?) on Mon, 21 May 2007 12:53:38 GMT]]></title><description><![CDATA[<p>KasF schrieb:</p>
<blockquote>
<p>Wäre es möglich das du TPrimitive auch mal postest ?</p>
</blockquote>
<p>siehe oben <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>weitere Erkenntnisse: Ich hab mein main() jetzt nur auf die ersten 2-3 Zeilen reduziert (Definitionen der TInt's a b und c) - er spuckt mir immernoch ins Gesicht:</p>
<pre><code>/tmp/ccT1pvrf.o(.gnu.linkonce.t._ZN4TIntD1Ev+0x2d): In function `TInt::~TInt [in-charge]()':
: undefined reference to `operator delete(void*)'
/tmp/ccT1pvrf.o(.gnu.linkonce.t._ZN10TPrimitiveD2Ev+0x22): In function `TPrimitive::~TPrimitive [not-in-charge]()':
: undefined reference to `operator delete(void*)'
/tmp/ccT1pvrf.o(.gnu.linkonce.t._ZN4TIntD0Ev+0x2d): In function `TInt::~TInt [in-charge deleting]()':
: undefined reference to `operator delete(void*)'
/tmp/ccT1pvrf.o(.gnu.linkonce.t._ZNK4TInt3isAEv+0xe): In function `TInt::isA() const':
: undefined reference to `std::allocator&lt;char&gt;::allocator[in-charge]()'
/tmp/ccT1pvrf.o(.gnu.linkonce.t._ZNK4TInt3isAEv+0x28): In function `TInt::isA() const':
: undefined reference to `std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;::basic_string[in-charge](char const*, std::allocator&lt;char&gt; const&amp;)'
/tmp/ccT1pvrf.o(.gnu.linkonce.t._ZNK4TInt3isAEv+0x33): In function `TInt::isA() const':
: undefined reference to `std::allocator&lt;char&gt;::~allocator [in-charge]()'
/tmp/ccT1pvrf.o(.gnu.linkonce.t._ZNK4TInt3isAEv+0x46): In function `TInt::isA() const':
: undefined reference to `std::allocator&lt;char&gt;::~allocator [in-charge]()'
/tmp/ccT1pvrf.o(.gnu.linkonce.r._ZTI4TInt+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
/tmp/ccT1pvrf.o(.gnu.linkonce.t._ZNK10TPrimitive3isAEv+0xe): In function `TPrimitive::isA() const':
: undefined reference to `std::allocator&lt;char&gt;::allocator[in-charge]()'
/tmp/ccT1pvrf.o(.gnu.linkonce.t._ZNK10TPrimitive3isAEv+0x28): In function `TPrimitive::isA() const':
: undefined reference to `std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;::basic_string[in-charge](char const*, std::allocator&lt;char&gt; const&amp;)'
/tmp/ccT1pvrf.o(.gnu.linkonce.t._ZNK10TPrimitive3isAEv+0x33): In function `TPrimitive::isA() const':
: undefined reference to `std::allocator&lt;char&gt;::~allocator [in-charge]()'
/tmp/ccT1pvrf.o(.gnu.linkonce.t._ZNK10TPrimitive3isAEv+0x46): In function `TPrimitive::isA() const':
: undefined reference to `std::allocator&lt;char&gt;::~allocator [in-charge]()'
/tmp/ccT1pvrf.o(.gnu.linkonce.t._ZN10TPrimitiveD1Ev+0x22): In function `TPrimitive::~TPrimitive [in-charge]()':
: undefined reference to `operator delete(void*)'
/tmp/ccT1pvrf.o(.gnu.linkonce.t._ZN10TPrimitiveD0Ev+0x22): In function `TPrimitive::~TPrimitive [in-charge deleting]()':
: undefined reference to `operator delete(void*)'
/tmp/ccT1pvrf.o(.gnu.linkonce.r._ZTI10TPrimitive+0x0): undefined reference to `vtable for __cxxabiv1::__class_type_info'
/tmp/ccT1pvrf.o(.eh_frame+0x12): undefined reference to `__gxx_personality_v0'
</code></pre>
<p>Allmaehlich krieg ich den bloeden Eindruck dass er so rein garnichts von alleine mitlinkt, dass ich ihm irgendwelche Grundlegenden Kleinigkeiten explizit zum Linken mit angeben muss <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>
]]></description><link>https://www.c-plusplus.net/forum/post/1289044</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1289044</guid><dc:creator><![CDATA[pumuckl]]></dc:creator><pubDate>Mon, 21 May 2007 12:53:38 GMT</pubDate></item><item><title><![CDATA[Reply to [Solved] Linkerfehler (ehem. Typkonvertierung?) on Mon, 21 May 2007 13:00:57 GMT]]></title><description><![CDATA[<p>pumuckl schrieb:</p>
<blockquote>
<pre><code>weitere Erkenntnisse: Ich hab mein main() jetzt nur auf die ersten 2-3 Zeilen reduziert (Definitionen der TInt's a b und c) - er spuckt mir immernoch ins Gesicht:
[code]/tmp/ccT1pvrf.o(.gnu.linkonce.t._ZN4TIntD1Ev+0x2d): In function `TInt::~TInt [in-charge]()':
: undefined reference to `operator delete(void*)'
/tmp/ccT1pvrf.o(.gnu.linkonce.t._ZN10TPrimitiveD2Ev+0x22): In function `TPrimitive::~TPrimitive [not-in-charge]()':
: undefined reference to `operator delete(void*)'
/tmp/ccT1pvrf.o(.gnu.linkonce.t._ZN4TIntD0Ev+0x2d): In function `TInt::~TInt [in-charge deleting]()':
: undefined reference to `operator delete(void*)'
/tmp/ccT1pvrf.o(.gnu.linkonce.t._ZNK4TInt3isAEv+0xe): In function `TInt::isA() const':
: undefined reference to `std::allocator&lt;char&gt;::allocator[in-charge]()'
/tmp/ccT1pvrf.o(.gnu.linkonce.t._ZNK4TInt3isAEv+0x28): In function `TInt::isA() const':
: undefined reference to `std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;::basic_string[in-charge](char const*, std::allocator&lt;char&gt; const&amp;)'
/tmp/ccT1pvrf.o(.gnu.linkonce.t._ZNK4TInt3isAEv+0x33): In function `TInt::isA() const':
: undefined reference to `std::allocator&lt;char&gt;::~allocator [in-charge]()'
/tmp/ccT1pvrf.o(.gnu.linkonce.t._ZNK4TInt3isAEv+0x46): In function `TInt::isA() const':
: undefined reference to `std::allocator&lt;char&gt;::~allocator [in-charge]()'
/tmp/ccT1pvrf.o(.gnu.linkonce.r._ZTI4TInt+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
/tmp/ccT1pvrf.o(.gnu.linkonce.t._ZNK10TPrimitive3isAEv+0xe): In function `TPrimitive::isA() const':
: undefined reference to `std::allocator&lt;char&gt;::allocator[in-charge]()'
/tmp/ccT1pvrf.o(.gnu.linkonce.t._ZNK10TPrimitive3isAEv+0x28): In function `TPrimitive::isA() const':
: undefined reference to `std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;::basic_string[in-charge](char const*, std::allocator&lt;char&gt; const&amp;)'
/tmp/ccT1pvrf.o(.gnu.linkonce.t._ZNK10TPrimitive3isAEv+0x33): In function `TPrimitive::isA() const':
: undefined reference to `std::allocator&lt;char&gt;::~allocator [in-charge]()'
/tmp/ccT1pvrf.o(.gnu.linkonce.t._ZNK10TPrimitive3isAEv+0x46): In function `TPrimitive::isA() const':
: undefined reference to `std::allocator&lt;char&gt;::~allocator [in-charge]()'
/tmp/ccT1pvrf.o(.gnu.linkonce.t._ZN10TPrimitiveD1Ev+0x22): In function `TPrimitive::~TPrimitive [in-charge]()':
: undefined reference to `operator delete(void*)'
/tmp/ccT1pvrf.o(.gnu.linkonce.t._ZN10TPrimitiveD0Ev+0x22): In function `TPrimitive::~TPrimitive [in-charge deleting]()':
: undefined reference to `operator delete(void*)'
/tmp/ccT1pvrf.o(.gnu.linkonce.r._ZTI10TPrimitive+0x0): undefined reference to `vtable for __cxxabiv1::__class_type_info'
/tmp/ccT1pvrf.o(.eh_frame+0x12): undefined reference to `__gxx_personality_v0'
</code></pre>
</blockquote>
<p><img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /> Kann ich jetzt nichts zu sagen, aber was anderes:</p>
<pre><code class="language-cpp">template&lt;class Func, class T&gt; class TBinaryExec : public TExec
{
public:
  virtual void operator() (TPrimitive&amp; result, std::vector&lt;TPrimitive*&gt; arglist) const
    {
      Func binfct;
      T&amp; res = static_cast&lt;T&amp;&gt;(result);
      res = binfct(static_cast&lt;T&amp;&gt;(*arglist[0]), static_cast&lt;T&amp;&gt;(*arglist[1]));
      return;
    };
  ~TBinaryExec() {};

};
</code></pre>
<p>Spar die hier dein zweiten Templateparameter, indem du es so machst:</p>
<pre><code class="language-cpp">template&lt;class Func&gt; class TBinaryExec : public TExec
{
public:
  typedef typename Func::result_type T;
virtual void operator() (TPrimitive&amp; result, std::vector&lt;TPrimitive*&gt; arglist) const
    {
      Func binfct;
      T&amp; res = static_cast&lt;T&amp;&gt;(result);
      res = binfct(static_cast&lt;T&amp;&gt;(*arglist[0]), static_cast&lt;T&amp;&gt;(*arglist[1]));
      return;
    };
  ~TBinaryExec() {};

};
</code></pre>
<p>Ist auch sicherer und konsistenter.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1289054</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1289054</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Mon, 21 May 2007 13:00:57 GMT</pubDate></item><item><title><![CDATA[Reply to [Solved] Linkerfehler (ehem. Typkonvertierung?) on Mon, 21 May 2007 13:17:17 GMT]]></title><description><![CDATA[<p>stimmt, sieht schoener aus.</p>
<p>ich hab jetzt mal aus volkards kleinem Tutorial das Hello World ausgeschnipselt und dem Compiler zu fressen gegeben:</p>
<pre><code class="language-cpp">#include &lt;iostream.h&gt;
int main()
{
  cout &lt;&lt; &quot;Hallo Welt!&quot; &lt;&lt; endl;
};
</code></pre>
<p>Die erste Meldung versteh ich ja noch:</p>
<pre><code>In file included from /opt/products/gcc/3.3.3/include/g++-3/backward/iostream.h:31,
                 from hallowelt.cpp:2:
/opt/products/gcc/3.3.3/include/g++-3/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the &lt;X&gt; header for the &lt;X.h&gt; header for C++ includes, or &lt;sstream&gt; instead of the deprecated header &lt;strstream.h&gt;. To disable this warning use -Wno-deprecated.
</code></pre>
<p>Aber dann kommt das Biest mit folgendem:</p>
<pre><code>/tmp/ccbQP0IY.o(.text+0x1b): In function `main':
: undefined reference to `std::cout'
/tmp/ccbQP0IY.o(.text+0x20): In function `main':
: undefined reference to `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/ccbQP0IY.o(.text+0x28): In function `main':
: undefined reference to `std::basic_ostream&lt;char, std::char_traits&lt;char&gt; &gt;&amp; std::endl&lt;char, std::char_traits&lt;char&gt; &gt;(std::basic_ostream&lt;char, std::char_traits&lt;char&gt; &gt;&amp;)'
/tmp/ccbQP0IY.o(.text+0x30): In function `main':
: undefined reference to `std::basic_ostream&lt;char, std::char_traits&lt;char&gt; &gt;::operator&lt;&lt;(std::basic_ostream&lt;char, std::char_traits&lt;char&gt; &gt;&amp; (*)(std::basic_ostream&lt;char, std::char_traits&lt;char&gt; &gt;&amp;))'
/tmp/ccbQP0IY.o(.text+0x59): In function `__static_initialization_and_destruction_0(int, int)':
: undefined reference to `std::ios_base::Init::Init[in-charge]()'
/tmp/ccbQP0IY.o(.text+0x74): In function `__static_initialization_and_destruction_0(int, int)':
: undefined reference to `std::ios_base::Init::~Init [in-charge]()'
/tmp/ccbQP0IY.o(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'
</code></pre>
<p>Das halte ich dann doch schon fuer sehr 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>
<p>Allerdings kommt das nur wenn ich ihn mit</p>
<pre><code>gcc hallowelt.cpp
</code></pre>
<p>aufrufe. Nutze ich stattdessen g++, tut ers einwandfrei. Was ist da jetzt schief gelaufen? Hab ich die ganze Zeit meinen Compiler falsch behandelt? Ist er mir jetzt boese? *Kopf-&gt;Tisch*</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1289069</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1289069</guid><dc:creator><![CDATA[pumuckl]]></dc:creator><pubDate>Mon, 21 May 2007 13:17:17 GMT</pubDate></item><item><title><![CDATA[Reply to [Solved] Linkerfehler (ehem. Typkonvertierung?) on Mon, 21 May 2007 13:20:20 GMT]]></title><description><![CDATA[<p>pumuckl schrieb:</p>
<blockquote>
<p>...<br />
Die erste Meldung versteh ich ja noch:</p>
<pre><code>In file included from /opt/products/gcc/3.3.3/include/g++-3/backward/iostream.h:31,
                 from hallowelt.cpp:2:
/opt/products/gcc/3.3.3/include/g++-3/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the &lt;X&gt; header for the &lt;X.h&gt; header for C++ includes, or &lt;sstream&gt; instead of the deprecated header &lt;strstream.h&gt;. To disable this warning use -Wno-deprecated.
</code></pre>
<p>...</p>
</blockquote>
<p>Beheb' die doch erstmal !<br />
iostream.h -&gt; iostream</p>
<p>Gruß,</p>
<p>Simon2.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1289070</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1289070</guid><dc:creator><![CDATA[Simon2]]></dc:creator><pubDate>Mon, 21 May 2007 13:20:20 GMT</pubDate></item><item><title><![CDATA[Reply to [Solved] Linkerfehler (ehem. Typkonvertierung?) on Mon, 21 May 2007 13:28:18 GMT]]></title><description><![CDATA[<p>JUHU! ES KLAPPT!</p>
<ol>
<li>g++ statt gcc verwendet, auf einmal kennt er den ganzen Mist!</li>
<li>std::ostream&amp; operator&lt;&lt;(std::ostream, TInt) richtig definiert (war wohl keinem aufgefallen <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="🙂"
    /></li>
<li>natuerlich auf den richtigen iostream header umgestiegen</li>
<li>Kompiliert =&gt; funktioniert alles wie gewuenscht. Danke denen, die sich die Muehe gegeben haben, den Fehler mit einzugrenzen.</li>
</ol>
]]></description><link>https://www.c-plusplus.net/forum/post/1289077</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1289077</guid><dc:creator><![CDATA[pumuckl]]></dc:creator><pubDate>Mon, 21 May 2007 13:28:18 GMT</pubDate></item><item><title><![CDATA[Reply to [Solved] Linkerfehler (ehem. Typkonvertierung?) on Mon, 21 May 2007 13:40:32 GMT]]></title><description><![CDATA[<p>Ein richtiges Hello World Programm sieht für mich so aus:<br />
[code]<br />
#include &lt;iostream&gt;</p>
<p>int main()<br />
{<br />
std::cout &lt;&lt; &quot;Hello World&quot; &lt;&lt; std::endl;<br />
cin.get();<br />
}</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1289095</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1289095</guid><dc:creator><![CDATA[temporärer-gast]]></dc:creator><pubDate>Mon, 21 May 2007 13:40:32 GMT</pubDate></item><item><title><![CDATA[Reply to [Solved] Linkerfehler (ehem. Typkonvertierung?) on Mon, 21 May 2007 13:42:48 GMT]]></title><description><![CDATA[<p>bzw return 0; darf für mich nicht fehlen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
<pre><code>#include &lt;iostream&gt;

int main()
{
std::cout &lt;&lt; &quot;Hello World&quot; &lt;&lt; std::endl;
cin.get();
return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1289096</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1289096</guid><dc:creator><![CDATA[temporärer-gast]]></dc:creator><pubDate>Mon, 21 May 2007 13:42:48 GMT</pubDate></item><item><title><![CDATA[Reply to [Solved] Linkerfehler (ehem. Typkonvertierung?) on Tue, 22 May 2007 06:43:19 GMT]]></title><description><![CDATA[<p>pumuckl schrieb:</p>
<blockquote>
<p>JUHU! ES KLAPPT!</p>
<ol>
<li>g++ statt gcc verwendet, auf einmal kennt er den ganzen Mist!</li>
</ol>
</blockquote>
<p>Jaja, es kann schon Wunder bewirken, wenn man ein C++ Programm auch durch einen C++ Compiler jagt <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /> (der gcc ist ein C-Compiler)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1289551</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1289551</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Tue, 22 May 2007 06:43:19 GMT</pubDate></item><item><title><![CDATA[Reply to [Solved] Linkerfehler (ehem. Typkonvertierung?) on Tue, 22 May 2007 06:59:35 GMT]]></title><description><![CDATA[<p>... für einen C-Compiler hat er aber unheimlich viel C++ verstanden *grml* <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /><br />
Naja, wieder so ein Fehler, den man genau einmal macht *fg*</p>
<p>Wenn ichs richtig mitbekommen hab, ist g++ auch nur gcc mit ein paar zusätzlichen Linker optionen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1289562</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1289562</guid><dc:creator><![CDATA[pumuckl]]></dc:creator><pubDate>Tue, 22 May 2007 06:59:35 GMT</pubDate></item><item><title><![CDATA[Reply to [Solved] Linkerfehler (ehem. Typkonvertierung?) on Tue, 22 May 2007 07:04:25 GMT]]></title><description><![CDATA[<p>pumuckl schrieb:</p>
<blockquote>
<p>Wenn ichs richtig mitbekommen hab, ist g++ auch nur gcc mit ein paar zusätzlichen Linker optionen?</p>
</blockquote>
<p>Nein. C und C++ sind zwei Unterschiedliche Sprachen.</p>
<p>Genauso ist der gcj kein gcc &quot;mit ein paar zusätzlichen Linkeroptionen&quot; <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1289567</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1289567</guid><dc:creator><![CDATA[LordJaxom]]></dc:creator><pubDate>Tue, 22 May 2007 07:04:25 GMT</pubDate></item><item><title><![CDATA[Reply to [Solved] Linkerfehler (ehem. Typkonvertierung?) on Tue, 22 May 2007 07:40:42 GMT]]></title><description><![CDATA[<p>pumuckl schrieb:</p>
<blockquote>
<p>...Wenn ichs richtig mitbekommen hab, ist g++ auch nur gcc mit ein paar zusätzlichen Linker optionen?</p>
</blockquote>
<p>Früher (vor der Standardisierung) gab's mal &quot;C++2C-Präprozessoren&quot;, die C++-Code in C-Code wandelten und den dann durch einen C-Compiler jagten ... aber die Zeiten sind schon länger vorbei.</p>
<p>Aber gräme Dich nicht: Der Irrglaube C++ sei &quot;eigentlich C&quot; ist leider recht weit verbreitet. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
<p>Gruß,</p>
<p>Simon2.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1289585</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1289585</guid><dc:creator><![CDATA[Simon2]]></dc:creator><pubDate>Tue, 22 May 2007 07:40:42 GMT</pubDate></item><item><title><![CDATA[Reply to [Solved] Linkerfehler (ehem. Typkonvertierung?) on Tue, 22 May 2007 07:45:08 GMT]]></title><description><![CDATA[<p>mir ist durchaus bekannt, dass C und C++ zwei verschiedene Sprachen sind. Ich habe grade mal auf <a href="http://gcc.gnu.org" rel="nofollow">http://gcc.gnu.org</a> nachgestöbert und meien vage Erinnerung halbwegs bestätigt gefunden, dass mit &quot;gcc&quot;-Aufruf keineswegs nur der C-Compiler aufgerufen wird. gcc steht für Gnu Compiler Collection und der Guteste ist so nett, anhand der Dateiendungen zu unterscheiden, welchen seiner eingebauten Compiler er bemüht, z.B. den Fortran Compiler für Source mit Dateiendung .f, C-Compiler für .c, C++-Compiler für .C, .cpp, .cxx .c++ usw.</p>
<blockquote>
<p>However, the use of gcc does not add the C++ library. g++ is a program that calls GCC and treats <code>.c',</code>.h' and <code>.i' files as C++ source files instead of C source files unless -x is used, **and automatically specifies linking against the C++ library.** This program is also useful when precompiling a C header file with a</code>.h' extension for use in C++ compilations. On many systems, g++ is also installed with the name c++.</p>
</blockquote>
<p>Im gewissen Sinne also doch gcc plus Linkeroptionen und ein paar Kleinigkeiten, da gcc eben NICHT nur ein C-Compiler ist...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1289589</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1289589</guid><dc:creator><![CDATA[pumuckl]]></dc:creator><pubDate>Tue, 22 May 2007 07:45:08 GMT</pubDate></item><item><title><![CDATA[Reply to [Solved] Linkerfehler (ehem. Typkonvertierung?) on Tue, 22 May 2007 08:05:34 GMT]]></title><description><![CDATA[<p>pumuckl schrieb:</p>
<blockquote>
<p>mir ist durchaus bekannt, dass C und C++ zwei verschiedene Sprachen sind....</p>
</blockquote>
<p>Sorry, da habe ich mich unklar ausgedrückt. Ich meinte nicht Dich, sondern Deine Quellen, die evtl. diesen Fehler gemacht haben. Ich habe das einfach schon so oft in Internet gelesen, dass ich mich wundere, dass überhaupt noch jemand die Wahrheit kennt <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
<p>Die Erfahrung mit den &quot;Dateienden&quot; beim gcc habe ich auch schon bitter gemacht ... mag für einige praktisch sein, aber ich finde es eher fehlerträchtig.</p>
<p>Gruß,</p>
<p>Simon2.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1289616</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1289616</guid><dc:creator><![CDATA[Simon2]]></dc:creator><pubDate>Tue, 22 May 2007 08:05:34 GMT</pubDate></item></channel></rss>