Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Why do I get error "inconsistent dll linkage" ?

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"
 class FLITETTSPLUGIN_API Alex_test : public AActor, public IFliteTTSPlugin
     //virtual void StartupModule() override; 
     //virtual void ShutdownModule() override; 
      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"
 void Alex_test::citeste(FString str)
     UE_LOG(LogTemp, Warning, TEXT("%s"), *str);

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

Product Version: UE 4.18
more ▼

asked Sep 05 '18 at 03:27 PM in C++ Programming

avatar image

34 3 3 8

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

3 answers: sort voted first

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();

more ▼

answered Sep 05 '18 at 10:02 PM

avatar image

34 3 3 8

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

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"

more ▼

answered Sep 05 '18 at 07:34 PM

avatar image

263 2 4 6

avatar image BestWarrior Sep 05 '18 at 08:07 PM

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.

avatar image BestWarrior Sep 05 '18 at 08:12 PM

I wrote as you said, same problem

avatar image TheDreamCatcher Sep 05 '18 at 08:21 PM

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.

avatar image BestWarrior Sep 05 '18 at 08:41 PM

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().

avatar image BestWarrior Sep 05 '18 at 08:44 PM

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

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

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 :)

more ▼

answered May 24 '19 at 02:39 PM

avatar image

245 8 13 17

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question