Worked for me.
- Close MSVS
- Delete “YourProjectName/Intermediate” folder
- Regenerate C++ solution(Right click on uproject file - generate project files)
- Open MSVS
- Build Project
For me, the reason of issue was that old object files were in the “Intermediate” folder.