undefined reference to 'MyClass::MyClass()'
undefined reference to 'MyClass::add(char *, int)' //I made changes to the function, removed const
undefined reference to 'MyClass::~MyClass()'
undefined reference to 'MyClass::~MyClass()'
You need to add MyClass.cpp to the project (Project/Add files), so it is built and linked.
When you create new files within Code::Blocks (File/New/Empty File), this is done automatically.