Erez D wrote:
hi

i have encountered a problem with g++

i have a class a, with forward declaration of a function "do_something" and a constructor a(int val);
i implement them in a cpp file.

g++ complains of redefinition of the constructor but not of the do_something() function.

why ?

files:
== a.h ===
class a {
int m_a;
 a (int val);
 void do_somthing()
}

== a.cpp ===
#include "a.h"
a::do_somthing {a.m_a++;};
a::a(int val):m_a(val) {};

============


any idea ?

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).

Shachar

--
Shachar Shemesh
Lingnu Open Source Consulting Ltd.
http://www.lingnu.com

_______________________________________________
Linux-il mailing list
[email protected]
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il

Reply via email to