'Unreal Engine 5 Plugin: Missing import: UnrealEditor-SteamVR.dll

I have a plugin that fails to load initially when starting up my project and gives this error: The game module ‘PluginName’ could not be loaded. There may be an operating system error or the module may not be properly set up

When reviewing the log file I see that the issue is caused by:

Missing import: UnrealEditor-SteamVR.dll

If I copy this DLL from the Unreal Engine 5 plugins into my Plugin's Binary folder, the project will open as normal and load the plugin. However, this was not the case for Unreal Engine 4, so I'm trying to see why I need to copy this DLL now.

In my plugin Build CS file I have a reference to SteamVR. Maybe this needs to be updated?

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

How to get this to work without manually adding in the DLL?



Solution 1:[1]

I edited my .uplugin file and added the SteamVR plugin dependency, which resolved the issue.

"Plugins": [
    {
        "Name": "SteamVR",
        "Enabled": true
    }
]

Edit 1:

I discovered that though multiple Steam libs were included in my C++ it was a function from the SteamVRFunctionLibrary responsible for causing the issue on startup when the SteamVR plugin isn't enabled.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1