I also had this problem recently. I created a .bat file that will clear out unnecessary folders/files from your project. Not necessary but nice if you are on winblows.
I ran this bat file, all it does is delete intermediate,saved,binaries, and build folders and files.
then i generated vs prj files from uproject right-click menu.
set the default start up prj in vs2015 to your project (to ensure ue4 prj isnt startup prj)
rebuild with desired params and boom error gone, for me atleast.