I have a constructor attempting to initialize a field in a base class. The compiler complains. The field is protected, so derived classes should have access.
Your derived class constructor does have access, but you cannot assign to it in the initialisation list. Change the constructor to:
DerivedClass::DerivedClass(const std::string& data)
: BaseClass(data)
{
}
Alternatively, if no suitable base class constructor is available and you cant add one you can change the constructor to:
DerivedClass::DerivedClass(const std::string& data)
{
m_data = data;
}