SourceCode does not Compile properly as Plugin

j.windgassen
Mon, 26 Jul 2021 10:13:13 +0000
Plugins

Hey there.

I am currently trying to write an Unreal-Wrapper for the yaml-cpp library. But for some reason, whenever you try to use the plugin, Unreal has a hard time linking the code and you always get a bunch of Unresolved External Symbol Error Messages.

I added the same source files from the plugin in a fresh project directly as c++ files instead of a Plugin (In the Private/Public folder in the Source directory), which works flawlessly and compiles without any errors. But as soon as I put the files in a Plugin I get the linker errors again. The original library works with Exceptions and other std-classes, but since it compiles directly, I don’t see any particular reason why it shouldn’t be able to compile it in a Plugin.

I am probably just missing an option somewhere, but I can’t find it!

The whole Plugin can be found here, but I will post the most important files below:

UnrealYAML.uplugin:

{
	"FileVersion": 3,
	"Version": 1,
	"VersionName": "1.0",
	"FriendlyName": "UnrealYAML",
	"Category": "Other",
	"CanContainContent": true,
	"IsBetaVersion": false,
	"IsExperimentalVersion": false,
	"Installed": false,
	"Modules": [
		{
			"Name": "UnrealYAML",
			"Type": "Runtime",
			"LoadingPhase": "Default"
		}
	]
}

UnrealYaml.Build.cs

public class UnrealYAML : ModuleRules {
	public UnrealYAML(ReadOnlyTargetRules Target) : base(Target) {
		PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
		PublicDependencyModuleNames.AddRange(new[] {"Core", "Projects"});

		bEnableExceptions = true;
		bUseRTTI = true;

		PublicIncludePaths.Add(Path.Combine(PluginDirectory, "Source", "UnrealYAML", "yaml-cpp", "include"));
		PrivateIncludePaths.Add(Path.Combine(PluginDirectory, "Source", "UnrealYAML","yaml-cpp", "src"));
	}
}

UnrealYAML.h and UnrealYAML.cpp

class FUnrealYAMLModule : public IModuleInterface { };

IMPLEMENT_MODULE(FUnrealYAMLModule, UnrealYAML)

3 posts - 1 participant