# Why do I get error "inconsistent dll linkage" ?

**URL:** <https://forums.unrealengine.com/t/why-do-i-get-error-inconsistent-dll-linkage/433239>\
**Category:** Plugins\
**Tags:** dll, unreal-engine, Plugins, CPP, question\
**Created:** [September 5, 2018, 3:27pm UTC](https://forums.unrealengine.com/t/why-do-i-get-error-inconsistent-dll-linkage/433239 "2018-09-05T15:27:34Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![BestWarrior](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@BestWarrior](https://forums.unrealengine.com/u/BestWarrior)\
**Post date:** [September 5, 2018, 3:27pm UTC](https://forums.unrealengine.com/t/why-do-i-get-error-inconsistent-dll-linkage/433239/1 "2018-09-05T15:27:34Z")

</div>

Hi, I want to call a funciton from a plugin but I get this error “inconsistent dll linkage”.  
This is the header file

```
#pragma once

#include "CoreMinimal.h"
#include "../../Plugins/FliteTTSPlugin/Source/FliteTTSPlugin/Public/IFliteTTSPlugin.h"
#include "../../Plugins/FliteTTSPlugin/Source/FliteTTSPlugin/Public/FliteTTSPlugin.h"

#include "lex_test.generated.h"

/**
 * 
 */
 UCLASS()
class FLITETTSPLUGIN_API Alex_test : public AActor, public IFliteTTSPlugin
{
	//virtual void StartupModule() override; 
	//virtual void ShutdownModule() override; 
	
	GENERATED_UCLASS_BODY() 
	
	
public:
	Alex_test();
	~Alex_test();
	
	 UFUNCTION(BlueprintCallable, Category = "citeste")
	 void citeste(FString str);
	 
}; 

```

This is the source file

```
// Fill out your copyright notice in the Description page of Project Settings.
#include "MyProject.h"
#include "lex_test.h"

Alex_test::Alex_test()
{

}

Alex_test::~Alex_test()
{
}

void Alex_test::citeste(FString str)
{
	
	UE_LOG(LogTemp, Warning, TEXT("%s"), *str);
	
IFliteTTSPlugin::writefile();
	
}

```

The function I want to call is in FliteTTSPlugin file.  
Do you know how to do this? Thankyou.

---

<div class="post-metadata">

**Author:** ![TheDreamCatcher](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/thedreamcatcher/32/727178_2.png) [@TheDreamCatcher](https://forums.unrealengine.com/u/TheDreamCatcher)\
**Post date:** [September 5, 2018, 7:34pm UTC](https://forums.unrealengine.com/t/why-do-i-get-error-inconsistent-dll-linkage/433239/2 "2018-09-05T19:34:12Z")

</div>

you need to edit your Build.cs and add “FliteTTSPlugin” to your public dependency: `PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "FliteTTSPlugin" });`  
Check the proper name of the plugin Then Rebuild your project and it should be available using only `#inlcude "IFliteTTSPlugin.h"` and `#include "FliteTTSPlugin.h"`

---

<div class="post-metadata">

**Author:** ![BestWarrior](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@BestWarrior](https://forums.unrealengine.com/u/BestWarrior)\
**Post date:** [September 5, 2018, 8:07pm UTC](https://forums.unrealengine.com/t/why-do-i-get-error-inconsistent-dll-linkage/433239/3 "2018-09-05T20:07:10Z")

</div>

I forgot to mention this, I already edited the build.cs with “PrivateDependencyModuleNames.AddRange(new string[] { “FliteTTSPlugin” });  
PrivateIncludePathModuleNames.AddRange(new string[] { “FliteTTSPlugin” });”, should be public ? Problem is class FLITETTSPLUGIN\_API, if I delete this I get unresolved symbol.

---

<div class="post-metadata">

**Author:** ![BestWarrior](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@BestWarrior](https://forums.unrealengine.com/u/BestWarrior)\
**Post date:** [September 5, 2018, 8:12pm UTC](https://forums.unrealengine.com/t/why-do-i-get-error-inconsistent-dll-linkage/433239/4 "2018-09-05T20:12:18Z")

</div>

I wrote as you said, same problem

---

<div class="post-metadata">

**Author:** ![TheDreamCatcher](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/thedreamcatcher/32/727178_2.png) [@TheDreamCatcher](https://forums.unrealengine.com/u/TheDreamCatcher)\
**Post date:** [September 5, 2018, 8:21pm UTC](https://forums.unrealengine.com/t/why-do-i-get-error-inconsistent-dll-linkage/433239/5 "2018-09-05T20:21:47Z")

</div>

the thing is that this plugin was not updated in 2 years and it was incomplete at the time. You might not be able to make it work at all at least according the the readme of the plugin.

---

<div class="post-metadata">

**Author:** ![BestWarrior](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@BestWarrior](https://forums.unrealengine.com/u/BestWarrior)\
**Post date:** [September 5, 2018, 8:41pm UTC](https://forums.unrealengine.com/t/why-do-i-get-error-inconsistent-dll-linkage/433239/6 "2018-09-05T20:41:19Z")

</div>

I updated it, problem is not with the plugin files. The function I am trying to call is not from the plugin itself though I would like to. In FliteTTSPlugin.h I defined function writefile() which just make an UELOG for testing purposes and I want to call that function. If this will work, I will write some plugin functions in writefile().

---

<div class="post-metadata">

**Author:** ![BestWarrior](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@BestWarrior](https://forums.unrealengine.com/u/BestWarrior)\
**Post date:** [September 5, 2018, 8:44pm UTC](https://forums.unrealengine.com/t/why-do-i-get-error-inconsistent-dll-linkage/433239/7 "2018-09-05T20:44:27Z")

</div>

I found this "If you look at the plugin tutorials you’ll notice that IModule only has inline and pure virtual methods, and its parent class IModuleInterface likewise only contains inline methods, there’s no need to export anything in order to use either of those classes in your project because all the relevant information is already in the header files. The same thing applies to UE modules that don’t use MODULE\_API. In your case however, your FTestModule has a Test method that isn’t inline, nor pure virtual, which means that when you link your project against your module the linker is going to try and find the definition of that method in your module’s library. You can read more about the different ways to export classes from DLLs in this article. " in [link text](https://forums.unrealengine.com/development-discussion/c-gameplay-programming/12624-creating-a-module-problem-with-definitions-in-cpp)

---

<div class="post-metadata">

**Author:** ![BestWarrior](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@BestWarrior](https://forums.unrealengine.com/u/BestWarrior)\
**Post date:** [September 5, 2018, 10:02pm UTC](https://forums.unrealengine.com/t/why-do-i-get-error-inconsistent-dll-linkage/433239/8 "2018-09-05T22:02:54Z")

</div>

This was so easy, so I made these changes  
`UCLASS(MinimalAPI) class Alex_test : public AActor ... FFliteTTSPlugin* flite;`

and I called it like this flite-\>writefile();

---

<div class="post-metadata">

**Author:** ![BlueMind\_Studio](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@BlueMind\_Studio](https://forums.unrealengine.com/u/BlueMind_Studio)\
**Post date:** [May 24, 2019, 2:39pm UTC](https://forums.unrealengine.com/t/why-do-i-get-error-inconsistent-dll-linkage/433239/9 "2019-05-24T14:39:26Z")

</div>

Just to mention, got the error after adding a new c++ class to my existing sources and forgot by pasting in the code from an other project to fix the “YOURMODULENAME\_API” - which caused the same error messages 🙂

---

<div class="post-metadata">

**Author:** ![King\_Crazy](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@King\_Crazy](https://forums.unrealengine.com/u/King_Crazy)\
**Post date:** [July 7, 2021, 8:11pm UTC](https://forums.unrealengine.com/t/why-do-i-get-error-inconsistent-dll-linkage/433239/10 "2021-07-07T20:11:55Z")

</div>

This was the solution to my problem whilst looking this up. Thank you!

---

<div class="post-metadata">

**Author:** ![illYay](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@illYay](https://forums.unrealengine.com/u/illYay)\
**Post date:** [November 30, 2022, 5:49pm UTC](https://forums.unrealengine.com/t/why-do-i-get-error-inconsistent-dll-linkage/433239/11 "2022-11-30T17:49:57Z")

</div>

I had this driving me crazy in 5.1. Turns out I accidentally left a copy pasted

#include UE\_INLINE\_GENERATED\_CPP\_BY\_NAME()

In a .cpp file for a class that I was extending from the original class. I forgot to delete that line when I copied code from the original file.

---

<div class="post-metadata">

**Author:** ![helloserve](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/helloserve/32/88714_2.png) [@helloserve](https://forums.unrealengine.com/u/helloserve)\
**Post date:** [April 20, 2023, 8:52pm UTC](https://forums.unrealengine.com/t/why-do-i-get-error-inconsistent-dll-linkage/433239/12 "2023-04-20T20:52:09Z")

</div>

Faced the same incessant error, and my issue was that I had copied code from the engine to use as a base for a custom implementation but did not change the struct from ENGINE\_API to my own one.
