x

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"
 
 
 
 
 /**
  * 
  */
  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.

Product Version: UE 4.18
Tags:
more ▼

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

avatar image

BestWarrior
34 2 3 6

(comments are locked)
10|2000 characters needed characters left

2 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

BestWarrior
34 2 3 6

(comments are locked)
10|2000 characters needed characters left

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

TheDreamCatcher
253 2 4 5

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