[UE5.0.1] Error packaging plugin on windows 10 using VS2019

Hi!

I’m building UE5 project with Visual Studio 2019. I want to package a simple plugin but I got the following errors:

UATHelper: Package Plugin Task (Windows): C:/Users/SRT/Documents/Unreal/UE5_release/Engine/Source/Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(6,2): error: PLATFORM_WINDOWS not defined
UATHelper: Package Plugin Task (Windows): #error PLATFORM_WINDOWS not defined
UATHelper: Package Plugin Task (Windows):  ^
UATHelper: Package Plugin Task (Windows): C:/Users/SRT/Documents/Unreal/UE5_release/Engine/Source/Runtime/Core/Public\Windows/WindowsPlatformCompilerSetup.h(19,15): error: use of undeclared identifier '_MSC_VER'
UATHelper: Package Plugin Task (Windows): static_assert(_MSC_VER >= 1929, "Visual Studio 2019 v16.11 or greater is required to build Unreal Engine.");

I already tried the following BuildConfiguration.xml snipped:

<?xml version="1.0" encoding="utf-8" ?>
<Configuration xmlns="https://www.unrealengine.com/BuildConfiguration">
    <ProjectFileGenerator>
        <Format>VisualStudio2019</Format>
    </ProjectFileGenerator>
</Configuration>

What I do is click on “Edit > Plugins > MyPlugin > Package”. I notice that UE5.vcxproj has <VCProjectVersion>16.0</VCProjectVersion> but even if i change it to 16.11 manually the issue persist.

1 Like

What release version of VS2019 are you running?

You could also try downloading the community version of VS2022 - just make sure in the installation that you check/opt to use the C++ compiler for games/unreal

When I use the VS2022 an error related with VisualStudioCodeSourceAccess is triggered.

I’m using Visual Studio Community 2019 16.11.13 with .Net desktop development, Desktop development with C++, Universal Windows Platform development and Game development with C++ modules, also Windows 10 SDK 10.0.19041.0 and 10.018362.0

What I do was “right click on UE5 project >> build” then everything seemed to compile well, only the Plugin’s package option does not work well.

I have no idea why but unreal was failing but it seems to be fixed using the following snipped in .plugin file.

		{
			"Name": "Hdr10PlusStandardEditor",
			"Type": "Editor",
			"LoadingPhase": "PreDefault",
			"WhitelistPlatforms": [
				"Win64"
			],
			"BlacklistPlatforms": [
				"IOS",
				"Linux",
				"Android"
			]
		}
1 Like