How do I Statically link a plugin to my game code

OK, I think I am getting to the crux of the issue here. I have a plugin that contains an actor class. I would like to call methods on that actor from a game C++ file. I have read the plugins page very carefully and these two questions:(How exactly do game plugins work?, How to include the header from a plugin).

I have managed to get the include working but it is failing to link (for example, I can’t call StaticClass() on the class in question.

I have moved both the .h and .cpp file in to the public folder of the plugin but this hasn’t worked. My build.cs file contains this:

PrivateDependencyModuleNames.AddRange(new string[] { "VaOceanPlugin" });
PrivateIncludePathModuleNames.AddRange(new string[] { "VaOceanPlugin" });

 PrivateIncludePaths.AddRange(new string[] { "VaOceanPlugin/Public", "VaOceanPlugin/Classes", "VaOceanPlugin/Private" });

What further step(s) do I need to perform to statically link to a method? I can’t seem to work it out and having an explicit answer may help future people.

It sounds like the symbols for your class aren’t being exported. Are you declaring your class with an _API macro, like this?

class VAOCEANPLUGIN_API MyActorClass : public AActor
{
     ...
}

This page has more information on how the _API macros work: https://docs.unrealengine.com/latest/INT/Programming/Modules/API/index.html