4.16 not compiling/Failed to generate project files

Wanted to try upgrading to 4.16.1 from 4.15.0 (mainly for better Switch support).
I’m using Visual Studio Community 2015 version 14.0.25431.01 Update 3. (which is working perfectly with 4.15)
Windows 10

When trying to convert a 4.15 project to 4.16 it says: “Project files could not be generated.”

So I decided to try making a new project and coping files over.
I can’t make a new C++ project.

When creating a new blueprint project 4.16 doesn’t show the compile button.
Adding a new c++ class works, but tells me to recompile and that the project files couldn’t be generated.

When I close the blueprint project and reopen it (only if I added a c++ class) it won’t open and says:
“The following modules are missing or built with a different engine version:
UE4Editor-MyProject.dll
Would you like to rebuild them now?”
Pressing yes fails and tells me to rebuild from source manually.

Right clicking the Uproject to generate project files fails.

I’m assuming there must be something wrong with how Visual studio is set up, or maybe that I need an updated version (2017 version?). Does anyone know what might fix this?

Error message when generating project files:

An error occurred while trying to generate project files.

Running D:/Software/Epic Games/UE_4.16/Engine/Binaries/DotNET/UnrealBuildTool.exe -projectfiles -project=“D:/Documents/MyProject/MyProject.uproject” -game -rocket -progress
C:\Users\Name\Documents\Unreal Engine\UnrealBuildTool\BuildConfiguration.xml(54): The element ‘UEBuildConfiguration’ in namespace ‘https://www.unrealengine.com/BuildConfiguration’ has invalid child element ‘bCompilePhysX’ in namespace ‘https://www.unrealengine.com/BuildConfiguration’. List of possible elements expected: ‘bDoNotBuildUHT, bFailIfGeneratedCodeChanges, bForceDebugUnrealHeaderTool, bAllowHotReloadFromIDE, bForceHeaderGeneration’ in namespace ‘https://www.unrealengine.com/BuildConfiguration’.
C:\Users\Name\Documents\Unreal Engine\UnrealBuildTool\BuildConfiguration.xml(118): The element ‘BuildConfiguration’ in namespace ‘https://www.unrealengine.com/BuildConfiguration’ has invalid child element ‘bCheckExternalHeadersForModification’ in namespace ‘https://www.unrealengine.com/BuildConfiguration’. List of possible elements expected: 'LogLevel, bUseUBTMakefiles, DMUCSCoordinator, bDisableDebugInfo, bAdaptiveUnityDisablesPCH, bAllowXGE, bUseUHTMakefiles, bAllowLTCG, bUseCheckedPhysXLibraries, bSupportEditAndContinue, bXGENoWatchdogThread, bUseSharedPCHs, bAllowASLRInShipping, bLogDetailedActionStats, bForcePrecompiledHeaderForGameModules, bEditorDependsOnShaderCompileWorker, bUseShippingPhysXLibraries, bPrintDebugInfo, bDisableDebugInfoForGeneratedCode, LogFilename, bShowXGEMonitor, bPrintPerformanceInfo, bUsePerFileIntellisense, bCheckLicenseViolations, DMUCSDistProp, bUseMallocProfiler, PCHOutputDirectory, bUsePDBFiles, bUseActionHistory, bStopXGECompilationAfterErrors, bShouldDeleteAllOutdatedProducedItems, bOmitFramePointers, bAllowSNDBS, bGeneratedSYMFile, bUseIncludeDependencyResolveCache, bAddFastPDBToProjects, bUseIncrementalLinking, MaxProcessorCount, bOmitPCDebugInfoInDevelopment, bEnableCodeAnalysis, bAllowDistccLocalFallback, bIgnoreJunk, bCreateMapFile, ProcessorCountMultiplier, bVerboseDistccOutput, bStripSymbolsOnIOS, bAl…
C:\Users\Name\Documents\Unreal Engine\UnrealBuildTool\BuildConfiguration.xml(199): The element ‘WindowsPlatform’ in namespace ‘https://www.unrealengine.com/BuildConfiguration’ has invalid child element ‘bLogDetailedCompilerTimingInfo’ in namespace ‘https://www.unrealengine.com/BuildConfiguration’.

No luck :frowning: uninstalled VS 2015 and Installed VS 2017 and reinstalled 4.16, same problems.

After installing VS 2017 I checked UE4.15 for problems, New projects are generating project files, but having the UE4Editor-MyProject.dll issue again.

Compiling a copy of my current project in 4.15 gives a “Error LINK : fatal error LNK1181: cannot open input file ‘ws2_32.lib’”

Not sure if that was an issue before switching VS versions.

Does anything other than the 8.1 SDK and C++ have to be installed with VS?

I used the VS installer again to modify the installation and it said I had it installed, but ws2_32.lib was missing. I tried installing it separately and it added that file. UE 4.16 still isn’t able to generate project files, adding a new c++ project gives the error I added to the bottom of the original post.

Thanks for all the help so far!

If you can’t make a C++ project from scratch, you have a problem with your installation. Uninstall Visual Studio and reinstall (including Windows 8.1 SDK). You can use Visual Studio 2015 or 2017 with UE 4.16. You may also want to uninstall/reinstall UE just in case.

ws2_32.lib should be in the Windows 8.1 SDK, are you sure you installed the SDK ? Check you have ws2_32.lib on your disk and that the lib path of your project in VS includes the path where this file is.

Hello friend,
I had the exact same problem and I was getting very ■■■■■■ off but now I am very happy because I finally fixed it and can create c++ projects. Reinstalling Visual Studio and Unreal Engine didn’t fix the problem for me (at least not completely but it may have had some effect although I am not completely certain) What I did was:

  1. I went to this folder on my PC: “C:\Users\User\Documents\Unreal Engine\UnrealBuildTool”

  2. I made a backup of the file inside that folder (by copying it to another folder on my desktop)

  3. I deleted the file (NOT the whole folder but ONLY the file)

  4. I turned off Unreal Engine, the Epic Launcher, and Visual Studio

  5. I started Epic Launcher then launched engine with version 4.16.1 and created a c++ project successfully without those annoying errors.

If this doesn’t work for you, what I would have done next is try deleting the same BuildConfiguration file in the places listed inside the file itself as possible locations. Since most of those places don’t exist for some reason I would try using the search function of the file explorer to find the different UnrealBuildTool folder and delete the file (after backing them up) in the order of precedence that the list of folder locations in the BuildConfiguration file suggests.
I hope this fixes it for you like it fixed it for me.

I think the problem may have appeared because I may have created that file when using Unreal Engine version 4.15 to try an change some of the things but I am not at all sure about that.

Thanks! I was able to create a new C++ project without issue. Hopefully my current project can be upgraded relatively easily.