Since you skipped the definition of the classes, I'm assuming that “Location” does not have any virtual function? In order for dynamic_cast to work, Location must define at least one virtual method. That's what the compiler is trying to tell you.
In general, if you intend to store and delete children of “Location” via a pase-ptr, similar to this:
Location* location = new cladire();
// later
delete location;
Then you need to, at least, give Location a virtual destructor, otherwise you have a memory leak (the above code would not call the destructor.
class Location
{
public:
virtual ~Location(void) = default;
};
This would also fix the error you are getting, without the need to add any other virtual methods.
Note also that your example reeks of a code-smell, you should not need to downcast to a specific location like that. Location should have data-members/virtual functions to allow you to describe any specific location, and write any algorithm in terms of just the “Location” type. Downcasting is often a sigh of bad design.