Can't upgrade a project from 4.15.1 to 4.16.1

Hi,

I’m having trouble trying to upgrade my 4.15.1 version project to an early 4.16.1 version. The problem is i have some maps that are made at the 4.16 and another ones made on the 4.15…

So when i try to generate a new visual studio project file, i get the following error:

Running C:/Program Files/Epic Games/UE_4.15/Engine/Binaries/DotNET/UnrealBuildTool.exe  -projectfiles -project="D:/Dropbox/TopicPlayProjects/Old/All Maps Felipe/SolarTitans.uproject" -game -rocket -progress
Discovering modules, targets and source code for project...
ERROR: No 32-bit compiler toolchain found in C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\cl.exe

I already downloaded the Windows 8.1 SDK like i found on another thread, but the error persists, is there any solution over doing all the work again on the new version?

sorry about my english.

Hello. I’d like to help anyone still experiencing this issue, resolve the build error. I’ll be giving two point of views in a project I’ve been working on. The first is a plugin for MySQL, and the second is MyProject.Build.cs.

MySQL Plugin Build.cs file [UE4.15 to 16]

using System.IO;

namespace UnrealBuildTool.Rules
{
    using System.IO;

    public class MySQL : ModuleRules
    {
        public MySQL(TargetRules Target)
        {

            PublicIncludePaths.AddRange(
                new string[] {
                "MySQL/Public",
                "MySQL/Classes"
                    // ... add public include paths required here ...
                }
                );


            PrivateIncludePaths.AddRange(
                new string[] {
                "MySQL/Private",
                    // ... add other private include paths required here ...
                }
                );


            PublicDependencyModuleNames.AddRange(
                new string[]
                {
                "Core",
                "CoreUObject",
                "Engine"
                    // ... add other public dependencies that you statically link with here ...
                }
                );


            PrivateDependencyModuleNames.AddRange(
                new string[]
                {
                "CoreUObject",
                "Engine",
                "Slate",
                "SlateCore"
                    // ... add private dependencies that you statically link with here ...	
                }
                );


            DynamicallyLoadedModuleNames.AddRange(
                new string[]
                {
                    // ... add any modules that your module loads dynamically here ...
                }
                );

            UEBuildConfiguration.bForceEnableExceptions = true;
        }
    }
}

There are a few lines that you have to focus on to correct this issue. The first is, Unreal Engine now uses class type ReadOnlyTargetRules in the constructor. The constructor must also inherit from base class Target, : base(Target) like so. Another thing to focus on, which may be irrelevant in your case, but caused me issues for my project; since TargetRules is now ReadOnly, you must remove any lines that try to change a value of Target.

Here’s an example of what I mean:

public MySQL(TargetRules Target)
         {...}

must now be changed to:

 public MySQL(ReadOnlyTargetRules Target) : base(Target)
            {...}

If you were assigning any values to target, you must remove those as well (I used Target to force enable exceptions):

UEBuildConfiguration.bForceEnableExceptions = true;

This must be removed or commented out as such:

 // Can no longer use in 4.16 as TargetRules data type has been changed to a new data type called ReadOnlyTargetRules!
    //UEBuildConfiguration.bForceEnableExceptions = true;

in order to compile to 4.16.

MyProject.Build.cs [UE4.15 to 16]

The same goes for your project’s build file as well.

public class MyProject : ModuleRules
{
	public MyProject(TargetRules Target)
	{...}
}

must be changed to:

public class Defcon5Dev : ModuleRules
{
	public Defcon5Dev(ReadOnlyTargetRules Target)
	{...}

}

I didn’t have to inherit from base(Target) that time, but I’m not certain if that is a must or not for the Project.Build.cs file.

As for cajuuh’s issue, remove the 4.16 map files from your 4.15 project (if you haven’t already), perform the steps above on the 4.15 build files, then try upgrading your project to 4.16. (You can achieve this by going to your project’s .uproject file, right clicking, and selecting Switch Unreal Engine version…