There is a class DerivedClass which inherits from both BaseClassA and BaseClassB publicly. All classes have virtual functions to make sure the virtual table is built properly. BaseClassA and BaseClassB are located in Library1 and DerivedClass is in Library2. One function in Library1 retrieves a DerivedClass i…