how to setup visual studio 2015 for unreal engine 4.12
You don’t.
You only have to have it installed and it works out of the box.
This answer is kind of silly, so your question has to be another one.
Could you give more info, what is not working?
UUserWidget is always undefined
create widget and declare the widget in visual studio it shows some errors
Hello,
It looks like you’re already getting assistance with this issue over on: How to solve the error undefined - UI - Unreal Engine Forums
As a result, I’m going to close this question as a duplicate of the one linked above.
Please refer to that post for updates regarding the issue.
Have a great day