<div dir="ltr"><br><br><div class="gmail_quote">On Sun, Apr 26, 2009 at 3:43 PM, Shachar Shemesh <span dir="ltr"><<a href="mailto:shachar@shemesh.biz">shachar@shemesh.biz</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div dir="ltr" bgcolor="#ffffff" text="#000000"><div><div></div><div class="h5">
Erez D wrote:
<blockquote type="cite">
<div dir="ltr">hi<br>
<br>
i have encountered a problem with g++<br>
<br>
i have a class a, with forward declaration of a function "do_something"
and a constructor a(int val);<br>
i implement them in a cpp file.<br>
<br>
g++ complains of redefinition of the constructor but not of the
do_something() function.<br>
<br>
why ?<br>
<br>
files:<br>
== a.h ===<br>
class a {<br>
int m_a;<br>
a (int val);<br>
void do_somthing()<br>
}<br>
<br>
== a.cpp ===<br>
#include "a.h"<br>
a::do_somthing {a.m_a++;};<br>
a::a(int val):m_a(val) {};<br>
<br>
============<br>
<br>
<br>
any idea ?<br>
<br>
</div>
</blockquote></div></div>
Send an actual couple of files. What you sent is impossible to debug (I
doubt g++ does not complain that do_somthing is defined with no return
type and no parenthesis).<br>
<br>
Shachar</div></blockquote><div><br>you are right. i just wanted to give a small example instead of send my whole project to be inspected.<br>however after fixing the syntax of this small example, i can't seem to duplicate the problem that happened in the project.<br>
<br>so thanks anyway.<br><br>erez.<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div dir="ltr" bgcolor="#ffffff" text="#000000">
<br>
<pre cols="72">--
Shachar Shemesh
Lingnu Open Source Consulting Ltd.
<a href="http://www.lingnu.com" target="_blank">http://www.lingnu.com</a>
</pre>
</div>
</blockquote></div><br></div>