# Build error in C++ using Widgets

**URL:** <https://forums.unrealengine.com/t/build-error-in-c-using-widgets/222124>\
**Category:** C++\
**Tags:** unreal-engine\
**Created:** [December 17, 2019, 7:47pm UTC](https://forums.unrealengine.com/t/build-error-in-c-using-widgets/222124 "2019-12-17T19:47:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![BFuller](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@BFuller](https://forums.unrealengine.com/u/BFuller)\
**Post date:** [December 17, 2019, 7:47pm UTC](https://forums.unrealengine.com/t/build-error-in-c-using-widgets/222124/1 "2019-12-17T19:47:01Z")

</div>

Hello everyone

I’m having an issue with Widgets that are declared in C++

In the private member variable class UMainMenu\* Menu that attributes is set to private:

[https://forums.unrealengine.com/filedata/fetch?filedataid=179484&type=thumb&attachmentnodeid=](https://forums.unrealengine.com/filedata/fetch?filedataid=179484&type=thumb&attachmentnodeid=)

No problems there. However when declaring the methods with it’s implementation I’m getting a build error within the InGameLoadMenu() where it is stating on line 48 that “declaration of ‘Menu’ hides class member”

[https://forums.unrealengine.com/filedata/fetch?filedataid=179483&type=thumb&attachmentnodeid=](https://forums.unrealengine.com/filedata/fetch?filedataid=179483&type=thumb&attachmentnodeid=)

Okay I said to myself this is new? When I commented out the statement of UMenuWidget\* Menu = CreateWidget\<UMenuWidget\>(this, InGameMenuClass); it builds just fine. Vice versa it throws the same build error.

Can anyone assist in finding a way to change the syntax so it builds safely and correctly without, seeing this error. I have a github account but it is set to private, for anyone that wants to see the code in full, my github account tag name is: brandonfullerue4sc

Many thanks for any assistance and for the time in reading this issue.  
Brandon
