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"

Adding Userwidget classes causes compile errors

I have been migrating my old 4.7.6 project to 4.8.1 today and part of that is a simple minimap I made using a custom class based on UMG. However, when I add a class extended from the UserWidget class, I suddenly get compile errors from SlateWrapperTypes.h and a bunch of other UI related classes. Classes at the moment don't have content apart from the default Unreal generated content. I wanted to start out with empty classes before I start adding content, to make sure any errors I get are not a direct result of my code (good thing I did).

I have made sure to add "UMG", "Slate", "SlateCore" to the build file (in the addrange bit), so I am not sure what exactly is going wrong here.

The error in question (I only post the first 5 out of a whole washlist of errors. I reckon they share the same core issue);

Error 2 error C2079: 'FEventReply::NativeReply' uses undefined class 'FReply' E:\Game Development\Unreal4\Source\UnrealEngine 4.8.1\Engine\Source\Runtime\UMG\Public\Components\SlateWrapperTypes.h 58 1 ActionGamePrototype

Error 3 error C2027: use of undefined type 'FReply' E:\Game Development\Unreal4\Source\UnrealEngine 4.8.1\Engine\Source\Runtime\UMG\Public\Components\SlateWrapperTypes.h 53 1 ActionGamePrototype

Error 4 error C3861: 'Handled': identifier not found E:\Game Development\Unreal4\Source\UnrealEngine 4.8.1\Engine\Source\Runtime\UMG\Public\Components\SlateWrapperTypes.h 53 1 ActionGamePrototype

Error 5 error C3861: 'Unhandled': identifier not found E:\Game Development\Unreal4\Source\UnrealEngine 4.8.1\Engine\Source\Runtime\UMG\Public\Components\SlateWrapperTypes.h 53 1 ActionGamePrototype

Error 6 error C2146: syntax error : missing ';' before identifier 'FGetCheckBoxState_DelegateWrapper' E:\Game Development\Unreal4\Source\UnrealEngine 4.8.1\Engine\Intermediate\Build\Win64\UE4Editor\Inc\UMG\Widget.generated.h 33 1 ActionGamePrototype

Product Version: UE 4.8
Tags:
more ▼

asked Jun 30 '15 at 07:17 AM in C++ Programming

avatar image

cridia
815 30 26 105

avatar image Vadim Osipov Jul 09 '15 at 12:12 AM

Well I did the includes but it still does not compile. I have 250+ errors about UserWidget.h

I'm doing it in Third Person Example C++ 4.8.1

Did someone find a fix? Please help!

avatar image cridia Jul 09 '15 at 01:14 AM

Did you add "UMG", "Slate", "SlateCore" to the "PublicDependencyModuleNames.AddRange" thingy in your .Build.cs file?

avatar image Vadim Osipov Jul 09 '15 at 04:37 AM

Thanks a lot for getting back to me! I'm being stupid and included include "Runtime/UMG/Public/UMG.h" include "Runtime/UMG/Public/UMGStyle.h" include "Runtime/UMG/Public/Slate/SObjectWidget.h" include "Runtime/UMG/Public/IUMGModule.h" include "Runtime/UMG/Public/Blueprint/UserWidget.h" in the wrong place. now everything works fine.

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

2 answers: sort voted first

Okay nevermind, I made a stupid mistake. In transferring to the new version, I completely forgot that if you want to extend from the userwidget class, on top of adding to the build class, you also need to add

include "Runtime/UMG/Public/UMG.h"

include "Runtime/UMG/Public/UMGStyle.h" #include "Runtime/UMG/Public/Slate/SObjectWidget.h" #include "Runtime/UMG/Public/IUMGModule.h" #include "Runtime/UMG/Public/Blueprint/UserWidget.h"

to your project header file.

more ▼

answered Jun 30 '15 at 07:28 AM

avatar image

cridia
815 30 26 105

avatar image GamerDecathlete Aug 19 '15 at 07:07 PM

Where in your project header did you add this? I'm having the same problem

avatar image GamerDecathlete Aug 19 '15 at 07:18 PM

Just kidding, it was literally just "MyProjectName".h, I feel silly. Maybe my issue was a little different, looked like I was using "EngineMinimal.h" instead of "Engine.h". Adding those line also worked though.

avatar image davek May 07 '16 at 10:06 AM

Can someone please tell me where exactly is it written that you need to include all those headers in addition to UserWidget.h ? I literally spent hours trying to solve this problem and did not find one piece of documentation that would mention that.

avatar image RHZhang Jul 28 '17 at 12:20 PM

As I tried, only UMG.h is needed and indeed it must be placed in PCH (project header). I will not add a header in PCH until it is really needed, say, until the next time I meet another compile error.

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

answered Aug 06 '16 at 04:20 PM

avatar image

Hichigo
61 5 5

avatar image RHZhang Jul 28 '17 at 12:20 PM

As I tried, only UMG.h is needed and indeed it must be placed in PCH (project header). I will not add a header in PCH until it is really needed, say, until the next time I meet another compile error.

(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