RAD Studio
ContentsIndex
PreviousUpNext
E2171: Body has already been defined for function 'function'

A function with this name and type was previously supplied a function body. 

A function body can only be supplied once. 

One cause of this error is not declaring a default constructor which you implement. For example:

class A {
public:
   virtual myex();
};
A::A() {} // error

Having not seen you declare the default constructor in the class declaration, the compiler has had to generate one, thus giving the error message when it sees one. this is a correct example:

class A {
public:
   A();
   virtual myex();
};
A::A() {}
Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!