SebCAP160
(CAP160)
February 23, 2021, 10:12pm
1
Hi ,
I’m actually trying to make an editor widget which will allow me to create WidgetBlueprints (I want to make a tool to generate ingame menus).
I’ve created a class that derivates from UWidgetBlueprintFactory but when I try to compile i get LNK2019 errors.
i’ve implemented all functions from UWidgetBlueprintFactory, added the UMGEditor module to public dependecies and tried to use the full path for the WidgetBlueprintFactory.h include.
Don’t know what I’m missing or doing wrong.
Can someone help me please ?
Thanks.
STRiFE.x
(STRiFE)
February 23, 2021, 10:37pm
2
Make sure that you have the proper modules included for your project in the .Build.cs file. For widgets, that would be “UMG”.
PrivateDependencyModuleNames.AddRange(new string] { "UMG" });
(I swear to god I’m gonna macro this sentence lol)
SebCAP160
(CAP160)
February 23, 2021, 11:45pm
3
Thanks for the reply ,
I’ve already tried to add UMG module but no luck.
You can see in the attached picture my current build.cs
Edit : I’ve put it in public dependencies maybe thats why. I’ll try to put it in private.
Edit 2 : Same error when I put it in private dependencies .
SebCAP160
(CAP160)
February 24, 2021, 12:28am
4
I think it’s due to my implementation functions. With the attached pictures i can compile with succes but I’m sure that’s not the way to do so.
Thanks for any help.
STRiFE.x
(STRiFE)
February 24, 2021, 3:01pm
5
Can you check with the “UMGEditor” dependency module as well?
SebCAP160
(CAP160)
February 24, 2021, 5:35pm
6
I already tried this one and it doesn’t work, you can see it on the 3rd post of this topic (This was the first thing I made as I saw it in the documentation).
https://forums.unrealengine.com/development-discussion/c-gameplay-programming/1865561-problem-with-uwidgetblueprintfactory?p=1865584#post1865584
I kinda solved the problem using LE Extended Standard Library and blueprints, but still want to know why I can’t do it in c++.
Thanks for the help.
Tulpuh
(Tulpuh)
February 25, 2021, 7:40am
7
The reason you can’t do it is because of the MinimalAPI class specifier used in the UCLASS macro of UWidgetBlueprintFactory. See Class Specifiers | Unreal Engine 5.3 Documentation .
MinimalAPI
Causes only the class’s type information to be exported for use by other modules. The class can be cast to, but the functions of the class cannot be called (with the exception of inline methods). This improves compile times by not exporting everything for classes that do not need all of their functions accessible in other modules.
SebCAP160
(CAP160)
February 25, 2021, 3:45pm
8
Thanks for the explanation. Now I understand.