I am new to C++ in terms of large projects distributed over various source files.
When I compile(gcc compiler) I get the following error: undefined reference to 'C::C()'
I have this code:
/src/lib/abstract/A.cpp
#include "src/plugins/geo/C.h"
#include "B.h"
class A:public B
{
public;
A()
{
B m_b;
}
void speed()
{
m_b = new C();
m_b->cspeed();
}
}
/src/lib/B.h
class B
{
public:
virtual int cspeed();
}
in /src/pligins/geo/C.h
#include "B.h"
class C:public B
{ private:
int speed=5;
public:
C()
{}
int cspeed()
{
return speed;
}
}