Bug: 'C++ Compile Failed'. I Cannot create a C++ project

yeah, will do

Ok, I reinstalled VS2017 with all the required components, including a fresh ‘windows-8-1-sdk’ component. It was about a 6.5 GB install for me. and yes I did install the ‘Unreal Engine Installer’ component.

Got the Compile error message again, though it was smaller this time, same, LINK : fatal error LNK1181: cannot open input file ‘ws2_32.lib’ thingy.

here is the whole output log from VS after building the project:

***1>------ Build started: Project: UE4, Configuration: BuiltWithUnrealBuildTool Win32 ------

2>------ Build started: Project: Udemy_BuildingEscape, Configuration: Development_Editor x64 ------

2>Performing full C++ include scan (hot reloading a new target)

2>Creating makefile for hot reloading Udemy_BuildingEscapeEditor (no existing makefile)

2>Compiling game modules for hot reload

2>Target is up to date

2>Deploying Udemy_BuildingEscapeEditor Win64 Development…

2>Total build time: 1.77 seconds (NoActionsToExecute executor: 0.00 seconds)

========== Build: 2 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========***

The unreal editor does not load up the way it should.
Also I turned off my AntiVirus/Firewall and AntiMalware to see if that was blocking. It was NOT, so the bug is not caused by my security software. I get the same compile error regardless.

Build: 2 succeeded, 0 failed, 0 up-to-date, 0 skipped

According to your Output everything compiled fine. No Errors no failures. You should be able to open your Project now.

Can I ask you what you mean by the Editor does not load up the way it should? And where do you see the Error message again?

yeah its simple.

I click on UE4 4.16.1 > Browser opens up > I go to New Project > I go to C++ tab > I select Basic Code (my location is just C:\Unreal Projects) > I enter a name for the project > I punch the button Create Project > HERE THE ERROR HAPPENS, Project fails to compile and the UE4 editor will not open. I get and error message that says, ‘Compile Failed’ and it asks me if I want open the project with Visual Studio 2017. If I do this it tells me I can upgrade my toolset if I want to.

So that is the bug. No Unreal Editor, and a compile failure.

The project should Compile and the Unreal editor should open and I should be able to easily access any C++ classes by double clicking (that will cause VS2017 to load up with the code).

Here is list of VS2017 components installed:

.NET Framework 4 targeting pack

.NET Framework 4.5 targeting pack

.NET Framework 4.5.1 targeting pack

.NET Framework 4.5.2 targeting pack

.NET Framework 4.6 targeting pack

.NET Framework 4.6.1 SDK

.NET Framework 4.6.1 targeting pack

.NET Portable Library targeting pack

CLR data types for SQL Server

Date sources and servic references

Class Designer

ClickOnce Publishing

Dependency Validation

Developer Analytics tools

DGML editor

Git for Windows

GitHub extension for Visual Studio

Help Viewer

NuGet package manager

Static analysis toolsText Template Transformation

C# and Visual Basic Roslyn compilers

C++/CLI support

MSBuild

VC++ 2015.3 v140 toolset (x86x64)

VC++ 2017 v141 toolset (x86x64)

Visual C++ runtime for UWP

Visual C++ tools for CMake

Windows Universal CRT SDK

C++ profiling tools

Just-In-Time debugger

Profiling tools

Testing tools core features

C# and Visual Basic

F# language support

Visual Studio C++ core features

Graphics debugger and GPU profiler for DirectX

Unreal Engine Installer

Entity Framework 6 tools

Graphics Tools Windows 8.1 SDK

Visual C++ ATL Support

Windows 10 SDK (10.0.15063.0) for Desktop C++ x86 and x64

Windows 10 SDK (10.0.15063.0) for UWP: C++

Windows 8.1 SDK

Windows Univeral C Runtime

yeah, its not about classes, its just that there is a relationship problem between UE4 4.16.1 and VS2017, whether creating a BP project or a C++ project. something to do with an input file ‘ws2_32.lib’ not loading or something.

Check this link, these people are having the same problem, I am not alone in this bug.

I am still looking for a solution here…

Well, i am going to keep bumping this Bug till I get a good answer. But I can’t wait around, I am just going to have to go back to an earlier version.

I had same problem. Just go download Windows SDK 8.1

I already have ‘Windows SDK 8.1’ installed in my VS2017 components list, as you can see in the list above where I listed all my installed components.

Not strictly C++ related, but I’ve just wasted a heap of time trying to
track down why the Generate Project
Files command is silently failing for
some of my 4.16 projects. Turns out
it’s because of dependencies on
plugins that are not yet installed for
4.16 (which makes sense and was the case with previous versions too) but
changes to UBT in 4.16 seem to have
resulted in the error dialog not being
shown, so you just get a silent
failure.

So, for anyone experiencing the same
issue, remember that the likely cause
is plugin references inside your
.uproject file. If you disable them
there until the 4.16 plugin is
available, you should be able to
generate the project files.

This is a quote from someone, Possibly you can help me out with this? This may be the problem.

UE4 4.16.2 the newest version does not fix this Bug, below is the error report:

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 WorkorNoWork Development Win64 -project=“C:/Unreal Projects/WorkorNoWork/WorkorNoWork.uproject” -editorrecompile -progress -NoHotReloadFromIDE

Performing full C++ include scan (building a new target)

Creating makefile for WorkorNoWork (no existing makefile)

@progress push 5%

Parsing headers for WorkorNoWorkEditor
Running UnrealHeaderTool “C:\Unreal Projects*WorkorNoWork**WorkorNoWork*.uproject” “C:\Unreal Projects*WorkorNoWork*\Intermediate\Build\Win64**WorkorNoWorkEditor\Development**WorkorNoWorkEditor.uhtmanifest” -LogCmds=“loginit warning, logexit warning, logdatabase error” -Unattended -WarningsAsErrors -installed

Reflection code generated for WorkorNoWorkEditor in 6.3863317 seconds
@progress pop

Performing 8 actions (4 in parallel)

[2/8] Resource ModuleVersionResource.rc.inl

[3/8] Resource PCLaunch.rc

SharedPCH.Engine.cpp

WorkorNoWork.cpp

WorkorNoWork.generated.cpp

WorkorNoWorkGameModeBase.cpp

[7/8] Link UE4Editor-WorkorNoWork.dll

[8/8] Link UE4Editor-WorkorNoWork.lib

LINK : fatal error LNK1181: cannot open input file 'ws2_32.lib’

Creating library C:\Unreal Projects*WorkorNoWork*\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-WorkorNoWork.lib and object C:\Unreal Projects*WorkorNoWork*\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-WorkorNoWork.exp

ERROR: UBT ERROR: Failed to produce item: C:\Unreal Projects*WorkorNoWork*\Binaries\Win64\UE4Editor-WorkorNoWork.dll

Total build time: 39.60 seconds (Local executor: 0.00 seconds)

LINK : fatal error LNK1181: cannot
open input file ‘ws2_32.lib’

In the key line the problem is something related to ‘ws2_32.lib’.

MyProjectSTuff.dll [8/8] Link
UE4Editor-MyProjectSTuff.lib LINK :
fatal error LNK1181: cannot open input
file ‘ws2_32.lib’

Still does not work.

This looks like the same issue I had here where Tigan2 suggested to move (move instead of delete in case something goes wrong) the BuildConfiguration.xml file out of “C:\Users\User\Documents\Unreal Engine\UnrealBuildTool”, which worked for me as well.

I switched to an older version of UE4 (v. 4.10.4), which uses VS2015 (I installed using the default setup). C++ projects do not work in this version either. Here is error Message. The “LINK : fatal error LNK1181: cannot open input file ‘ws2_32.lib’” Message is gone, but I cannot create C++ projects in the UE4 4.10.4 either.

SEE PASTEBIN:

https://pastebin.com/xPKC441C

Your solution to delete or move the BuildConfiguration.xml file may have worked, but when I uninstalled and attempted to reinstall VS2017 (to get a clean and minimal install, save 8-10GB) I get this message. Know what is up with that?

This looks like the same issue I had
here where Tigan2 suggested to move
(move instead of delete in case
something goes wrong) the
BuildConfiguration.xml file out of
“C:\Users\User\Documents\Unreal
Engine\UnrealBuildTool”, which worked
for me as well.

deleting the BuildConfiguration.XML file did cause Unreal Engine 4.16.2 to load up a C++ project for me the way it is supposed to (both the Unreal Engine Editor and Visual Studio loading up together), But only one time.

I could not repeat this success. The XML file regenerates and the compile failure returns.

This is the second time now that I have gotten the thing to load up once correctly, then subsequently fail.

Also Visual Studio 2015 Community is not available for download anymore at visualstudio.com. I get the message:

Download Results Sorry, we couldn’t
find any downloads for you.

Ok, I don’t know what else to do so I used my Glary Utilities clean up tools package to ‘clean’ everything up in my computer, just hit it with everything. Whatever it did, it did fix the install problem so VS2017 installed correctly through the ‘UE4 project creation browser’. This method of install automatically selects necessary components, ‘Windows SDK 8.1’, ‘Unreal Engine Installer’, ‘Visual Studio C++ Core…’ etc… So everything needed is there, But I still get the same ‘Compile Failure’ error message and the UE4 Engine Editor will not load.

Deleting the BuildConfiguration.xml file in UE4 4.16 (searching through File Explorer) did work once, but only once. The file regenerates every time, the compile error subsequently returns and projects fail to compile and the UE4 Engine Editor will not load up.