Need VS 2017 to build plugins in 4.25?

Hello,

I’m migrating from 4.24 to 4.25 and when trying to rebuild any plugin i get the following error:

UnrealBuildTool.Main: ERROR: Visual Studio 2017 must be installed in order to build this target.
UnrealBuildTool.Main: BuildException: Visual Studio 2017 must be installed in order to build this target.

I’m using the following command line:

\UE4_Install\UE_4.25\Engine\Build\BatchFiles\RunUAT.bat BuildPlugin -Rocket -Plugin=<source dir>\Voxel.uplugin -TargetPlatforms=Win64 -Package=<target dir>\VoxResult

I have uninstalled VS2017 long ago and use 2019, and this used to work fine in 4.24.

I tried a full uninstall/reinstall of 4.25.

I tried to install the CS2017 toolchain from the visual studio installer.

No success so far.

Am i missing a new option in my RunUAT.bat usage ?

Thanks

Cedric

You can just create an empty C++ project, throw your plugins in the Plugins folder (in the project dir) and compile with VS 2019

Thanks, it worked and i can continue to work.
But it’s still a workaround, it would be interesting to understand why RunUAT.bat needs an old VS version all of a sudden.

I managed to work around this by installing VS2017 as well (so both 2017 and 2019). Still, this seems abnormal given that UBT has defaulted to VS2019 per the 4.25 release notes. My guess is that one of the automation tools is passing VS2017 to UBT as an argument.

I didn’t want to reinstall VS17, and didn’t need to thanks to the C++ project workaround.
But i hope you are right and this will be fixed in a forthcoming release.
Thanks for your post anyway.

I Got the same issue today.

Since commit https://github.com/EpicGames/UnrealEngine/commit/d2eef8ad310b6bf3fa11f11c87b092b13f6cd55b#diff-8b2f1cabc560a71f31afdffdab7ce939 you need to additionally pass parameter “-VS2019” in the runUAT.bat for building with Visual Studio 2019

Example:
“C:\Program Files\Epic Games\UE_4.25\Engine\Build\BatchFiles\RunUAT.bat” BuildPlugin -Rocket -Plugin=\plugin.uplugin -TargetPlatforms=Win64 -Package=\out -VS2019

3 Likes

Finally got a chance to test that, and it worked perfectly.
Thank you so much for that answer :slight_smile:

I don’t want to necro this but can we get more info for those that aren’t that well versed in packaging?
I found the RunUAT.bat file, now what do we do? paste that code anywhere? somewhere specific?
This issue persists in 4.26 also

Persists in 4.27 also
I click the “package” button inside the Plugins window so there is no bat file for me to add params to. Do I really need to have VS 2022, VS 2019 AND VS 2017 installed to package 2 scripts into a plugin??? I agree with the above question: I am at the bat file, now what? How do I get UE4 to pass extra params to the bat file when I try to build the plugin from inside the Plugins window?

So I just copied the command from the console, pasted it into the console, fixed the -2017 to -2019 and then it built just fine, leaving me with source files, binaries, ini files, resources etc. Clearly this is not the final step in the process of creating a plugin and yet that is where I come to a halt. Start in UE4, continue on the command line and then never complete the process since I have no idea what UE4 was going to do next. If only I could get UE4 to call the bat file with something other than -2017 then everything should work just fine but where do I tell it what version to use? I see it compiles SOME stuff in 2019 and then at one point it swaps over to 2017 (which I have never had on this brand new machine) and that is where the build dies. Where can I tell UE4 what version of VS to pass to the bat???

Just encountered this problem in 4.27. Here’s what I did to fix the problem.

  1. Pull engine source from github, switch branch to match the version of your engine install, and configure the project.
  2. In build target AutomationScripts.Automation, find BuildPluginCommand.Automation.cs. This is the build script for packaging your plugin.
  3. Search for bVS2019 in code, alter to your liking. I just hardcoded it to true.
  4. Compile this build target. This yields 5 shared libraries on my windows.
  5. Find your engine install, backup, and replace these libraries.

Now you can package the plugin from the editor, and it should work without extra hassle.

1 Like

See my answer.

Building for 4.27 or 5.0 with -2019 or -2022 flag, UBT is for some reason flagging -2017 half way through the process even though its using 2022 and I have no other IDE installed.

This is the command UBT runs on Line 91

CommandUtils.Run: Running: C:\Program Files\Epic Games\UE_4.27\Engine\Binaries\DotNET\UnrealBuildTool.exe UE4Game Win64 Development -Project=A:\Builds\Plugins\MyPlugin\HostProject\HostProject.uproject -plugin=A:\Builds\Plugins\MyPlugin\HostProject\Plugins\MyPlugin\MyPlugin.uplugin -iwyu -noubtmakefiles -manifest=A:\Builds\Plugins\MyPlugin\HostProject\Saved\Manifest-UE4Game-Win64-Development.xml -nohotreload -2017 -log="C:\Users\REDACTED\AppData\Roaming\Unreal Engine\AutomationTool\Logs\C+Program+Files+Epic+Games+UE_4.27\UBT-UE4Game-Win64-Development.txt"

Which then spits out this directly afterwards

ProcessResult.StdOut: ERROR: Visual Studio 2017 must be installed in order to build this target.

Quite the paradox

2 Likes

I’m getting some CPP compiler errors after making this change. Did this happen to anyone else?

Building UE4Game...
  Using Visual Studio 2022 14.33.31629 toolchain (C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629) and Windows 10.0.19041.0 SDK (C:\Program Files (x86)\Windows Kits\10).
  Building 1 action with 24 processes...
    [1/1] Module.MyPlugin.cpp
    Detected compiler newer than Visual Studio 2019, please update min version checking in WindowsPlatformCompilerSetup.h
    PathToPlugin/Plugin.cpp(44): error C2027: use of undefined type 'UWorld'
    C:\Projects\UnrealEngine\Engine\Source\Runtime\Core\Public\GenericPlatform/GenericPlatformMisc.h(1043): note: see declaration of 'UWorld'
    PathToPlugin/Plugin.cpp(55): error C2065: 'GEngine': undeclared identifier
    PathToPlugin/Plugin.cpp(58): error C2065: 'GEngine': undeclared identifier
    PathToPlugin/Plugin.cpp(58): error C3536: 'It': cannot be used before it is initialized
    PathToPlugin/Plugin.cpp(60): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    PathToPlugin/Plugin.cpp(60): error C2143: syntax error: missing ';' before '&'
    PathToPlugin/Plugin.cpp(60): error C2065: 'Context': undeclared identifier
    PathToPlugin/Plugin.cpp(60): error C2100: illegal indirection
    PathToPlugin/Plugin.cpp(62): error C2065: 'Context': undeclared identifier
    PathToPlugin/Plugin.cpp(62): error C2653: 'EWorldType': is not a class or namespace name
    PathToPlugin/Plugin.cpp(62): error C2065: 'Game': undeclared identifier
    PathToPlugin/Plugin.cpp(62): error C2065: 'Context': undeclared identifier
    PathToPlugin/Plugin.cpp(62): error C2653: 'EWorldType': is not a class or namespace name
    PathToPlugin/Plugin.cpp(62): error C2065: 'PIE': undeclared identifier
    PathToPlugin/Plugin.cpp(62): error C2065: 'Context': undeclared identifier
    PathToPlugin/Plugin.cpp(64): error C2065: 'Context': undeclared identifier
Took 4.3512055s to run UnrealBuildTool.exe, ExitCode=6
UnrealBuildTool failed. See log for more details. (C:\Projects\UnrealEngine\Engine\Programs\AutomationTool\Saved\Logs\UBT-UE4Game-Win64-Development.txt)
AutomationTool exiting with ExitCode=6 (6)
BUILD FAILED