I am having an issue with the wrong virtual function being called by C++. I did a clean and rebuild, but it still keeps happening.
Here is the reference structure:
CLIScumm (C++/CLI) -> NativeScummWrapper -> ScummVM
CLIScumm creates an instance of nativeScummWrapperOSystem (defined in nativeScummWrapper) and sets an external variable (defined in ScummVM) to it. nativeScummWrapperOSystem inherits from OSystem defined in ScummVM.
This line in ScummVM:
FilesystemFactory *factory = g_system->getFilesystemFactory();
This calls NativeScummWrapperOSystem::logMessage when it should be calling OSystem::getFilesystemFactory.
CliScrumm constructs an instance of FSNode (defined in ScummVM). It is in the constructor of that type that problematic line is called.
I have been using VisualStudio references to link the projects. I noticed that the reference for ScummVM in NativeScummWrapper has a yellow exclaimation mark and the full path has this error listed:
The "Microsoft.VisualStudio.ProjectSystem.References.UnresolvedBuildDependencyProjectReference" reference could not be resolved.
This could be the culprit but I am unsure.
In the method that calls the method which calls getFilesystemFactory (defined in CLIScumm) there is another call to a different method on the same nativeScummWrapperOSystem instance. This works.
Please let me know what other code I should show you; as this is a big project I am mindful not to paste massive blobs of code into the forum.