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.
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 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???
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.
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