The project could not be compiled. Would you like to open it in Visual Studio?

Hello Everyone,

I’m getting this compilation error and need assistance:

The project could not be compiled. Would you like to open it in Visual Studio?

Running C:/Program Files/Epic Games/UE_4.16/Engine/Binaries/DotNET/UnrealBuildTool.exe Section_01 Development Win64 -project=“C:/Users/michael/Documents/Unreal Projects/Section_01/Section_01.uproject” -editorrecompile -progress -NoHotReloadFromIDE
Creating makefile for Section_01 (no existing makefile)
Performing full C++ include scan (no include cache file)
@progress push 5%
Parsing headers for Section_01Editor
Running UnrealHeaderTool “C:\Users\michael\Documents\Unreal Projects\Section_01\Section_01.uproject” “C:\Users\michael\Documents\Unreal Projects\Section_01\Intermediate\Build\Win64\Section_01Editor\Development\Section_01Editor.uhtmanifest” -LogCmds=“loginit warning, logexit warning, logdatabase error” -Unattended -WarningsAsErrors -installed
Reflection code generated for Section_01Editor in 6.1492532 seconds
@progress pop
Performing 8 actions (4 in parallel)
[2/8] Resource ModuleVersionResource.rc.inl
[3/8] Resource PCLaunch.rc
SharedPCH.Engine.cpp
Section_01.cpp
Section_01.generated.cpp
Section_01GameModeBase.cpp
[7/8] Link UE4Editor-Section_01.dll
[8/8] Link UE4Editor-Section_01.lib
LINK : fatal error LNK1181: cannot open input file ‘ws2_32.lib’
Creating library C:\Users\michael\Documents\Unreal Projects\Section_01\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-Section_01.lib and object C:\Users\michael\Documents\Unreal Projects\Section_01\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-Section_01.exp
ERROR: UBT ERROR: Failed to produce item: C:\Users\michael\Documents\Unreal Projects\Section_01\Binaries\Win64\UE4Editor-Section_01.dll
Total build time: 42.15 seconds (Local executor: 0.00 seconds)

I tried to google this issue but could not identify the exact fix. Some people recommended reverting from VS version 3 to 2, but they were using VS 2015 and I’m currently using VS 2017. Those same suggestions were quite old so I thought it might be worth asking what I need to do before uninstalling everything. Thanks!

Edit: I figured out the problem and how to fix it. The problem was that some VS 2015 files were interfering somehow so I used the program and solution described in the top answer to this post – 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++ - Unreal Engine Forums

I hope this helps !