# Adding C++ DLL to Unreal Engine

**URL:** <https://forums.unrealengine.com/t/adding-c-dll-to-unreal-engine/1527550>\
**Category:** Programming & Scripting\
**Tags:** dll, linker-error, unreal-engine, CPP\
**Created:** [December 15, 2023, 2:05pm UTC](https://forums.unrealengine.com/t/adding-c-dll-to-unreal-engine/1527550 "2023-12-15T14:05:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jopanalegs](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Jopanalegs](https://forums.unrealengine.com/u/Jopanalegs)\
**Post date:** [December 15, 2023, 2:05pm UTC](https://forums.unrealengine.com/t/adding-c-dll-to-unreal-engine/1527550/1 "2023-12-15T14:05:38Z")

</div>

I am developing plugin, that uses my third-party dll. When I add C written dll, everything is okay, I had experience adding [cJSON](https://github.com/DaveGamble/cJSON), [libcurl](https://github.com/curl/curl) - they written in C. When I tried using C++ DLL, like I created custom dll for x64 windows, same configuration as in Unreal, project builds successfully, but after 75% on “Initializing” stage, I recieve error: “Error:There may be an operating system error or the module may not be properly set up”.

All my classes and structs have structure like this:

```auto
#pragma once

// definition derived to shared header, show here for example
#ifdef MTX_API
#define MTX_API __declspec(dllexport)
#else
#define MTX_API __declspec(dllimport)
#endif

struct MTX_API ClassName
{
	ClassName();
	ClassName(float);
	~ClassName();
private:
	float fps;
};

```

I’m linking my custom dll and dependant dlls through additional include paths, additional libraries and runtime dependencies. Did I missed something in my Custom DLL project? or something’s wrong on my UE side implementation?
