# SourceCode does not Compile properly as Plugin

**URL:** <https://forums.unrealengine.com/t/sourcecode-does-not-compile-properly-as-plugin/486612>\
**Category:** Plugins\
**Tags:** unreal-build-tool, compiling, modules, unreal-engine, Plugins, question, CPP\
**Created:** [July 26, 2021, 10:13am UTC](https://forums.unrealengine.com/t/sourcecode-does-not-compile-properly-as-plugin/486612 "2021-07-26T10:13:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![j.windgassen](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@j.windgassen](https://forums.unrealengine.com/u/j.windgassen)\
**Post date:** [July 26, 2021, 10:13am UTC](https://forums.unrealengine.com/t/sourcecode-does-not-compile-properly-as-plugin/486612/1 "2021-07-26T10:13:13Z")

</div>

Hey there.

I am currently trying to write an Unreal-Wrapper for the [yaml-cpp library](https://github.com/jbeder/yaml-cpp). 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](https://gitlab.jsc.fz-juelich.de/windgassen1/unreal-yaml)**, 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)

```

---

<div class="post-metadata">

**Author:** ![Kehel18](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kehel18](https://forums.unrealengine.com/u/Kehel18)\
**Post date:** [July 26, 2021, 3:18pm UTC](https://forums.unrealengine.com/t/sourcecode-does-not-compile-properly-as-plugin/486612/2 "2021-07-26T15:18:38Z")

</div>

Hello! Can you try this one for your plugin?

```
		// ... add public include paths required here ...
		PublicIncludePaths.AddRange(new string[] { Path.Combine(ModuleDirectory, "Public") });

		// ... add other private include paths required here ...
		PrivateIncludePaths.AddRange(new string[] { Path.Combine(ModuleDirectory, "Private") });
```

---

<div class="post-metadata">

**Author:** ![j.windgassen](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@j.windgassen](https://forums.unrealengine.com/u/j.windgassen)\
**Post date:** [July 26, 2021, 4:33pm UTC](https://forums.unrealengine.com/t/sourcecode-does-not-compile-properly-as-plugin/486612/3 "2021-07-26T16:33:19Z")

</div>

Unfortunately, that doesn’t change anything!
