Error compiling with GCC

André Felício andre at felicio.com.br
Mon Dec 15 07:23:58 UTC 2003


Hi,

I am trying to compile a simple program in C++ and I am not obtaining.  This 
returning the following error:

[andre at antigerme poli]$ g++ test.cpp
/tmp/ccwB8kUB.o(.text+0x18): In function `main':
: undefined reference to `B::B[in-charge]()'
/tmp/ccwB8kUB.o(.text+0x2d): In function `main':
: undefined reference to `B::~B [in-charge]()'
collect2: ld returned 1 exit status
[andre at antigerme poli]$

Basically I am trying you work with polimorf in the GCC.

The simple program is:

class A {
     public:
             A();
             ~A();
};

class B: public A {
     public:
             B();
             ~B();
};

int main(void) {
      A *a;
      B b;
      a = new B();
}

Could a help me?

Thanks
[]'s





More information about the fedora-list mailing list