# How can i avoid "type UUserWidget incomplete" error in VS?

**URL:** <https://forums.unrealengine.com/t/how-can-i-avoid-type-uuserwidget-incomplete-error-in-vs/320983>\
**Category:** UI\
**Tags:** unreal-engine, slate, UI, Visual-Studio, Widget, question, UMG\
**Created:** [June 7, 2015, 4:27pm UTC](https://forums.unrealengine.com/t/how-can-i-avoid-type-uuserwidget-incomplete-error-in-vs/320983 "2015-06-07T16:27:23Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ljms](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ljms](https://forums.unrealengine.com/u/ljms)\
**Post date:** [June 7, 2015, 4:27pm UTC](https://forums.unrealengine.com/t/how-can-i-avoid-type-uuserwidget-incomplete-error-in-vs/320983/1 "2015-06-07T16:27:23Z")

</div>

Hi there,  
i try to extend the UserWidget class with my own C++ class and followed the tutorial here:

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — ue4community.wiki! You will be able to find content from the official...

But i get the “red lines” in Visual Studio in my new UserWidget class with the following error:  
Type UUserWidget is incomplete

The header file looks like this:

```
#pragma once
#include "Blueprint/UserWidget.h"
#include "BottomInfoUserWidget.generated.h"

UCLASS()
class MYGAME_API UBottomInfoUserWidget : public UUserWidget
{
	GENERATED_BODY()
};

```

I also included UMG, Slate and SlateCore to my Build file and added the header files to my MyGame.h file

```
//MyGame.Build.cs
using UnrealBuildTool;

public class MyGame : ModuleRules
{
	public MyGame(TargetInfo Target)
	{
        PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "UMG" });

        PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" });
		

	}
}

```

MyGame.h

```
#pragma once

#include "Engine.h"
#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"

```

I already saw this post [here](https://answers.unrealengine.com/questions/89089/inherit-from-class-userwidget-umg.html) but already did everything they suggested.

The code compiles and the Editor / Game runs fine but i still get this annoying errors in visual studio. Is there something i can do about it?

EDIT:  
I also have the VS configuration of this link here:  
[https://docs.unrealengine.com/latest/INT/Programming/Development/VisualStudioSetup/index.html](https://docs.unrealengine.com/latest/INT/Programming/Development/VisualStudioSetup/index.html)

My IntelliSense configuration:

![45734-2015-06-09+18_45_44-options.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/2/e/42e86bba0cccc2c220d85907a83b85d4481413e7.png)

---

<div class="post-metadata">

**Author:** ![Kory](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kory](https://forums.unrealengine.com/u/Kory)\
**Post date:** [June 9, 2015, 3:38am UTC](https://forums.unrealengine.com/t/how-can-i-avoid-type-uuserwidget-incomplete-error-in-vs/320983/2 "2015-06-09T03:38:38Z")

</div>

Duplicate question: [intellisense errors](https://answers.unrealengine.com/questions/7678/how-to-disable-intellisense-error-reporting.html)

---

<div class="post-metadata">

**Author:** ![ljms](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ljms](https://forums.unrealengine.com/u/ljms)\
**Post date:** [June 9, 2015, 4:47pm UTC](https://forums.unrealengine.com/t/how-can-i-avoid-type-uuserwidget-incomplete-error-in-vs/320983/3 "2015-06-09T16:47:06Z")

</div>

I have the proposed visual studio configuration from this link: [Setting Up Visual Studio for Unreal Engine | Unreal Engine Documentation](https://docs.unrealengine.com/latest/INT/Programming/Development/VisualStudioSetup/index.html)  
So intellisense can’t be the reason for the problem. except the documentation is not corrent anymore?  
I have adjusted my description.

---

<div class="post-metadata">

**Author:** ![Kory](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kory](https://forums.unrealengine.com/u/Kory)\
**Post date:** [June 9, 2015, 5:56pm UTC](https://forums.unrealengine.com/t/how-can-i-avoid-type-uuserwidget-incomplete-error-in-vs/320983/4 "2015-06-09T17:56:28Z")

</div>

I see you are using GENERATED\_BODY, you need to define a constructor with that (AFAIK).

---

<div class="post-metadata">

**Author:** ![ljms](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ljms](https://forums.unrealengine.com/u/ljms)\
**Post date:** [June 9, 2015, 8:45pm UTC](https://forums.unrealengine.com/t/how-can-i-avoid-type-uuserwidget-incomplete-error-in-vs/320983/5 "2015-06-09T20:45:11Z")

</div>

According to this post [here](https://answers.unrealengine.com/questions/139183/actor-code-incorrectly-generated-in-version-460.html) i don’t need a constructor anymore since 4.6.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b666e59e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b666e59e](https://forums.unrealengine.com/u/anonymous_user_b666e59e)\
**Post date:** [June 9, 2015, 9:01pm UTC](https://forums.unrealengine.com/t/how-can-i-avoid-type-uuserwidget-incomplete-error-in-vs/320983/6 "2015-06-09T21:01:21Z")

</div>

Hi ,

By “red lines” do you mean the squiggle lines where Intellisense detects errors?

![45771-squiggle.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/7/5/a75f39e92e2e83b22f7c743024b766bddf724ec7.png)

I use Visual Assist, and generally have Intellisense turned off, so I don’t see these squiggles. In general, any Intellisense errors can be ignored. The code that you provided is fine, and shouldn’t provide any actual problems. With Intellisense enabled however, you are likely to see a large number of “errors” in the Error List.

 ![45772-errors.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/e/8/4e8ddd399517e715ce7b354295c9d030432e49bf.png)

None of these errors will prevent the project from building successfully, though. Intellisense tends to have a difficult time with large code bases, such as UE4, and the large amount of reflection that takes place in the Unreal Build Tool when building a project in Visual Studio doesn’t help either. As you use the Engine, you will learn what errors are actually important, and which ones can be safely ignored.

---

<div class="post-metadata">

**Author:** ![ljms](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ljms](https://forums.unrealengine.com/u/ljms)\
**Post date:** [June 10, 2015, 7:30am UTC](https://forums.unrealengine.com/t/how-can-i-avoid-type-uuserwidget-incomplete-error-in-vs/320983/7 "2015-06-10T07:30:13Z")

</div>

So in this case it wasn’t the fault of Intellisense but Resharper (Jetbrain VisualStudio Extension). When i disable Code Inspection the squiggle are gone. Unfortunately i couldn’t find the setting for this particular error so i have to turn it off completely. Thanks for the help.

Your can also exclude some files from analysis to remove “wrong” errors in certain files.
