[SOLVED] fatal error C1853 on Plugin Packaging only

Hi,
after a VS2017C update I made yesterday, I get the following error when packaging my plugin (multiple times for each pch):

D:\UE4\MyProjects\EOC\RTSPluginV194\RTS\HostProject\Plugins\RTS\Intermediate\Build\Win64\UE4Editor\Development\RTS\Module.RTS.gen.2_of_4.cpp: fatal error C1853: ‘D:\Programs\Epic Games\UE_4.21\Engine\Intermediate\Build\Win64\UE4Editor\Development\Engine\SharedPCH.Engine.h.pch’ precompiled header file is from a previous version of the compiler, or the precompiled header is C++ and you are using it from C (or vice versa)

I have tried to clean everything, deleting all project and plugin .vs, Binary, Intermediate, Saved folders, regenerating solution, then rebuilding, but no help…

Beside the VS update, I have also created a Git source control previously, but in theory it cannot disturb anything…

Of course just in the worst possible moment, I should add it to a new project within days…

Any idea? Thanks :slight_smile:

bump

we’re having the same issue over here. Updated visual studio today and it compiled fine. But when we go to package the plugin we get the same error. We tried the same stuff you did and nada.

using UE 4.21.1, and visual studio 2017 v15.9.4

Any solutions yet? Honestly haven’t even been able to narrow down whether it’s an unreal issue or a visual studio issue. It’s been rough lol

Unreal 4.21+ requires definition of a proper pch in Build.cs of every module/plugin now.

[USER=“434”]BrUnO XaVIeR[/USER] it worked fine previously with UE4.21.1 1 week ago. Only VS was updated, now reinstalling, maybe something went wrong with update and a fresh install could help, no other ideas, really…

You can disable it:


using System.IO;
using UnrealBuildTool;

public class UWorks : ModuleRules
{
    public UWorks(ReadOnlyTargetRules Target) : base(Target)
    {
        PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
        bFasterWithoutUnity = true;
        MinFilesUsingPrecompiledHeaderOverride = 1;

        PrivateDependencyModuleNames.AddRange
        (
            new string]
            {
                "Core",
                "CoreUObject",
                "Engine",
                "Projects",
            }
        );
    }
}

a new version of windows10 SDK was also installed imo it could be a reason, I will see soon…

PROFIT!

Problem solved, imo no full reinstall needed, just modify VS installation, and keep only the latest Win10 SDK (uncheck old version, apparently UE4 uses it for pch creation somehow, but the latest for everything else, but I’m not a pro, just guessing)

Was having the same issue, tried unchecked old version didn’t work, only a full reinstall VS fixed for me.

hehe, the same fun with last VS update! only full reinstall helps, really… :confused:

Thx for mentioning :slight_smile: Today I made the VS Update to 2017.15.9.11 and I couldn´t packaging any Plugin I wanted to update. Only a full Re-Install of VS2017 did the trick.

Sooooo I had visual studio 2019 installed which also installed Windows SDK 10.0.18362.0, I had to uninstall it and then it all worked as Unreal defaulted to the right SDK.

I try uninstall VS2019 and Unreal
Install again and not work too…
what i doo?

select the proper Win SDK when installing VS, in each UE4 release notes its compatibility is mentioned somewhere…

In your BuildConfiguration.xml you can specifiy which compiler version to use. After the C++ 16.3 mess, I did.

(Pre 4.24 I used 14.22.27905)


<?xml version="1.0" encoding="utf-8" ?>
<Configuration xmlns="https://www.unrealengine.com/BuildConfiguration">
    <WindowsPlatform>
        <CompilerVersion>14.22.27906</CompilerVersion>
        <Compiler>VisualStudio2019</Compiler>
    </WindowsPlatform>
    <VCProjectFileGenerator>
        <Version>VisualStudio2019</Version>
    </VCProjectFileGenerator>
</Configuration>

Deleting Build, Intermediate, Saved and Visual Studio .sln file then rebuilding worked for me.

2 Likes

I can confirm the solution to only have the latest Windows 10 SDK checked in the Visual Studio Installer worked for me.

I feel better information to the developer is needed. The information provided by the error is misleading: "**precompiled header file is from a previous version of the compiler, or the precompiled header is C++ and you are using it from C (or vice versa)". In this particular case, Visual Studio is updated, and for some reason, Unreal can compile projects the same, but cannot continue to package plugins, even a simple templated plugin with no changes to the original auto-created code.

That solved for me!
Thanks @jman2015!

Thank you, this fixed the same error for me :)! I didn’t delete Saved, because in my case, that gave me an error when right-clicking .uproject, Generate Visual Studio Project Files.
After that, in visual studio 2017, I right-clicked the game project, Set as Startup Project, Ctrl+F5, Packaged from the editor and it worked :D!

I solved it too with repair the visual studio from visual studio installer.

The cause of this problem is probably that you update your visual studio.

the solution is very simple, dont have to reinstall your vs and engine, all you have to do is go to you engine install folder and find

\UE_4.21\Engine\Intermediate\Build\Win64\UE4Editor\Development\Engine\SharedPCH.Engine.h.pch

Delete it.

Then delete Build, Intermediate,save folder in your project (inclue intermediate in your plugin).

right click .uproject, rebuild Visual Studio .sln.

then your project will be allright to package

2 Likes