Cannot compile unreal engine 4 c++ project with vistual studio 2017

I created a c++ project in unreal engine 4.20.2.Then,I got an error said no projectname.dll finded and i should compile manully with visual studio 2017.When i start my compilation with vs2017 i got 1 waring and 3 errors:

Warning MSB4011 "D:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Microsoft.Makefile.props" cannot be imported again. 
It was already imported at "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.cpp.props (31,3)". 
This is most likely a build authoring error. This subsequent import will be ignored. [D:\Yanglixiao\ueproj\why\Intermediate\ProjectFiles\why.vcxproj]

Error   LNK1181 cannot open input file 'wininet.lib'    why D:\Yanglixiao\ueproj\why\Intermediate\ProjectFiles\LINK 1   

Error   MSB3073 The command ""D:\Program Files\Epic Games\UE_4.20\Engine\Build\BatchFiles\Rebuild.bat" whyEditor Win64 Development "D:\Yanglixiao\ueproj\why\why.uproject" -WaitMutex -FromMsBuild" exited with code -1.    why C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets

I searched the error and i got “New C++ Project fails to compile using UE 4.15 and VS 2017 Community Edition - LINK : fatal error LNK1181: cannot open input file 'ws2_32.lib' - C++ - Epic Developer Community Forums”,howerer, it didn’t works for me.(I had installed vs2015 before and i had unintalled it already) I thought the "wininet.lib"is the key and i searched it and i find it in “C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17134.0\um\x86” and there are many other copies.The configuration is a mess for me right now. I think i’m going crazy after reinstall&repair vs2017 and ue4 many times.

Since this is the first result for the wininet.lib linker issue, I thought I’d share my solution. What really fixed it for me was regenerating the project files via GenerateProjectFiles.bat

1 Like