Why am I getting the "UE4Editor-MyGame.dll is missing from your computer" error on my new computer?

Why am I getting the “UE4Editor-MyGame.dll is missing from your computer” error on my new computer?

I never had any issues building and launching the game; however, I recently got a new development computer. Now, whenever I get latest, build, and run the game, I get the following error:

The program can’t start because UE4Editor-MyGame.dll is missing from your computer. Try reinstalling the program to fix this problem.

None of my coworkers are experiencing this error, and I had never encountered this error on my old computer. All my development paths are the same between the new and old machine. I am able to successfully launch the game by making the following changes to FModuleDescriptor::LoadModulesForPhase():

void FModuleDescriptor::LoadModulesForPhase(ELoadingPhase::Type LoadingPhase, const TArray<FModuleDescriptor>& Modules, TMap<FName,     EModuleLoadResult>& ModuleLoadErrors)
{
  FScopedSlowTask SlowTask(Modules.Num());

#pragma region DLL Path Hack

  // #HACK: Force the module manager to search the game folder for .dlls.
  // This directory should already be searched, but Unreal can't find any .dlls in
  // this directory without explicitly adding it here.
  FModuleManager::Get().AddBinariesDirectory(TEXT("E:\\UE4\\MyGame_Dev\\MyGame\\Binaries\\Win64"), true);

#pragma endregion DLL Path Hack
	
  for(int Idx = 0; Idx < Modules.Num(); Idx++)
  {
    ...

What could be causing this issue? Could it be a missing path variable or registry value? It doesn’t prevent development, but it is disconcerting that, while my coworkers can run the game straight from the depot, I have to modify engine files to run successfully. Any help would be greatly appreciated!

Edit

I did notice this little gem a few lines down:

// @todo plugin: DLL search problems.  Plugins that statically depend on other modules within this plugin may not be found?  Need to test this.

// NOTE: Loading this module may cause other modules to become loaded, both in the engine or game, or other modules 
//       that are part of this project or plugin.  That's totally fine.

Not sure if the “DLL search problems” could be a computer-specific thing, or if it was ever tested. In any case, if it wasn’t tested, it would appear that they need to be tested. :slight_smile:

It looks like that was added by Ben Marsh for CL 2119335 in commit 8d04b79. Not sure if this info helps, but it’s where this function was originally implemented and where it’s failing.

Yes. I’ve done full rebuilds, and I’ve even deleted all local files and got a clean copy of the codebase.

One concern I have is the fact that we are checking in the binaries for artists. I’m not sure if that could cause any issues on only my computer, however.

Have you rebuilt the engine since being on your new computer?

Are you on Mac or Windows?

We’ve had this issue pop up on quite a few artist machines.
Currently doing some horrible hacks like copying our game DLLs into the engine\binaries\win64 folder, because the solution of hard coding in the game binaries location fails miserably when everyone has their workspace mapped to some random drive.
Windows only so far.

I would recommend not sharing the binaries between computers. While I can’t say for sure that is the issue, it certainly sounds like it could be.

The documentation says that the following folders “should” be added to your SVN / Perforce:

  • Config
  • Content
  • Source
  • ProjectName.uproject
  • ProjectName_Preview.png (if it exists)

As for Binaries, it says its “optional”, which suggest that maybe its not the cause of your issue but the documentation is also a bit out of date.

I will keep looking around and see if I can come up with a more concrete solution.

I’m running Windows 7. I’m using Visual Studio 2015 for development and Perforce for source control.

Thanks, Kyle. As a follow-up, if binaries aren’t submitted, how would you recommend people who don’t build locally (artists, level designers, et cetera) stay up-to-date with developers?

Is the “MyGame” bit before .dll the name of your game project or of a plugin you have installed for your project?

Yeah, not submitting binaries seems a bit impossible.
We don’t generally submit directly from developer machines, we do have a continuous build system that handles that particular magic.
However most of our machines work just fine, but 10% or so seem to have this problem.
While we’re seeing this issue more on new machines, we’ve had at least one developer who has had this problem for probably over a year now. So this has been happening across multiple engine versions.

They would need to download Visual Studio, get either the Release branch you are on via Epics GitHub / get your groups version of the engine, and build the engine.

Now, that is a judgement call on your end, which I think is why the SVN / Perforce documentation says that including the binaries is “optional”.

For your issue, I would try this, just as a sanity check.

Get the 4.12 branch from Epics GitHub and run through the steps:

  • Run Setup.bat and wait for the dependancies to download.
  • Run GenerateProjectFiles.bat
  • Open UE4.sln
  • Compile 4.12 (Development Editor)
  • Run via Visual Studio
  • Create a new C++ Project.
  • Run the project via Visual Studio

See if that functions.

This doesn’t sound right considering all binaries should be using relative paths.

The missing dll is the core game dll. It is the result of compiling your main game project. Theoretically I can confirm this since moving my entire project directory to another directory allows me to open the game with the editor. What is more concerning is that it says “Try reinstalling the program to fix this problem.”. Normally if the dll is missing UBT would ask you if you want to rebuild them.

103471-capture.png

If this message is not appearing my only guess is that it does not provide this option on computers that don’t have Visual Studio installed. That doesn’t resolve the issue that the dll exists in the first place, though. With regards to that we may need to see how the dll is being referenced in the .build.cs file as well as the modules listed in the .uproject file.

Also, can you navigate to:

UnrealProjectsDirectory/GameProject/Binaries/Win64 

See if your “UE4Editor-MyGame.dll” file is there. (My assumption is that it wont be)

Can you also let me know if you have the source code for your engine or if you are a artist on the team relying on the binaries?

I have source, and a compiler.
Our artists are syncing the same repo, so while they have source, they don’t have a compiler to rebuild with.
All of the binaries are there, and I’ve deleted and resynced their workspaces multiple times while working through solutions. The problem does seem to solve itself when I copy the binaries from /Binaries/Win64 into Engine/Binaries/Win64. So everything is building properly, it just seems to fail oddly when trying to load.

I’ve even tried explicitly adding our game/binaries/win64 to the PATH environment variable, but that did not help. Seems the engine ignores PATH when trying to track down plugins and modules.

When you launch the project, do you always launch through the launcher or through the .uproject?

Or, do you launch the game project through Visual Studio?

I ask because I have been seeing what happens when i start moving things around and deleting files. Whenever I launch the game project through Visual Studio, it rebuilds what I’ve moved or deleted and loads the project fine. Whereas, if I do the same and try to launch through the .uproject, it gives me a flat error with no ability to remedy it.

I always use the uproject, I’ve actually never installed the launcher on my primary dev machine. Our art team is split, some have installed the launcher, some haven’t. For art folks hitting this bug, I know at least 2 of them didn’t have the launcher installed, and at least 1 does.

Can you try on a machine that is experiencing this issue that also happens to have the source code and Visual Studio, launching the game project .sln file and then pressing the “Local Windows Debugger” button.

Might take a few minutes for Visual Studio to “warm up” but let me know if the editor will launch and if you still get the same issue launching through Visual Studio.

Thanks.

It’s the name of my game project.

It’s 100% there. That’s why the hack mentioned in the original question works.