From Source: The game module could not be found

The unreal installer version worked perfectly on my PC. I’m switching over to full source today and have it compiled. I run in Developer Editor configuration and run Unreal Engine. I get the project manager and created a new project.

Once I did that Unreal created a new solution file with the engine and game and I can compile and run that and get back to the project manager UI. I click open to open my created project and I get this error:

The game module ‘RTS’ could not be found. Please ensure that this module exists and that it is compiled.

In the solution if I try to build the ‘RTS’ project I get error:

Error 6 error : Couldn’t find target rules file for target ‘RTSEditor’ in rules assembly ‘RTSEditorModuleRules’

Any idea’s to what I’ve done wrong? Thanks.

If I create a Blank project then it works with no errors. I suspect that is my issue and you cannot use the C++ templates when you create a new project from sources.

Same problem here, built from source.

Finally figured it out. Here’s what you do. Run the DOS command-line with administrator privileges. Then, CD into the directory under your github repo that has \Engine\Build\BatchFiles. Then run RegisterShellCommands.bat.

Running that will make it so that when you right-click on a .uproject file and click “Generate Visual Studio projects”, it will create a .sln that is set up to use the editor under your source code directory instead of the installed one. So, do this for your project’s .uproject file.

Then, open up the .sln for your project and Build it with the Development Editor/Win64 configuration. Press F5. Voila.

From what I understand, the engine cannot find the moduleprefix of the game, because it wants to load the module prefix from the current executable (which is the editor) and thus, it doesn’t find a path. Consequently, it does not fill the Module Structure and ends up with an empty record for the game module.

For reference, look at the file ModuleManager.cpp. I think the FindModulePathsInDirectory might have an issue…

Please note that I have zero experience with the engine, so I might be wrong.

This does not work for me.

I believe that your project might live under the engine directory, so maybe the engine is able to find your module that way?

No, my project is in a different directory. To make sure that the solution rebuilt correctly, open up your project’s .sln, let’s call it MyGame. So right-click MyGame in Solution Explorer and go to Properties. On the left, under Configuration Properties, highlight NMake. Make sure that the Build Command Line option looks like \Engine\Build\BatchFiles\Build.bat MyGame Win64 Debug “$(SolutionDir)$(SolutionName).uproject” and not C:\Program Files\Unreal Engine\4.0\Engine\Build\BatchFiles\Build.bat MyGame Win64 Debug “$(SolutionDir)$(SolutionName).uproject” -rocket.

Thank you, I’ll give it a shot!

However, when I press Generate Visual Studio projects on the uproject file, it doesn’t copy the engine in my current project.

Ok I am debugging the GameBinariesDirectories array, it’s looking for a subdirectory called Binaries in the root directory of my module. This sub directory does NOT exists.

So I created a project called test2, and I cannot find the output dll even tho the build system seem to link it. So my problem seem to be that this dll is somewhere else, and should instead be under the subdir Binaries…

1> link.exe UE4Editor-test2-Win64-Debug.dll
1> Creating library F:\Sources\github\unrealprojects\test2\Intermediate\Build\Win64\test2Editor\Debug\UE4Editor-test2-Win64-Debug.lib and object

The linker tool is not being generated with the correct command-line.

As you can see, the /OUT:“F:\Binaries\Win64\UE4Editor-test2-Win64-Debug.dll” in my case is not good! It should be

Command line: “C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools…/…/VC/bin/x86_amd64/link.exe” /MANIFEST:NO /NOLOGO /DEBUG /errorReport:prompt /MACHINE:x64 /SUBSYSTEM:WINDOWS /FIXED:No /NXCOMPAT /STACK:5000000 /DELAY:UNLOAD /DLL /OPT:NOREF /OPT:NOICF /INCREMENTAL:NO /ignore:4199 /ignore:4099 /NODEFAULTLIB:“MSVCRTD” /NODEFAULTLIB:“MSVCPRTD” /NODEFAULTLIB:“LIBC” /NODEFAULTLIB:“LIBCMT” /NODEFAULTLIB:“LIBCPMT” /NODEFAULTLIB:“LIBCP” /NODEFAULTLIB:“LIBCD” /NODEFAULTLIB:“LIBCMTD” /NODEFAULTLIB:“LIBCPMTD” /NODEFAULTLIB:“LIBCPD” @“F:\Sources\github\unrealprojects\test2\Intermediate\Build\Win64\test2Editor\Debug\UE4Editor-test2-Win64-Debug.dll.response” /OUT:“F:\Binaries\Win64\UE4Editor-test2-Win64-Debug.dll” /IMPLIB:“F:\Sources\github\unrealprojects\test2\Intermediate\Build\Win64\test2Editor\Debug\UE4Editor-test2-Win64-Debug.lib” /PDB:“F:\Binaries\Win64\UE4Editor-test2-Win64-Debug.pdb” /ignore:4078

Awh AH! Found the problem!

Because my sources live in a root folder called F:\Sources, the system actually detects the string Source in the path name :

UEBuildTarget.cs CreateModule function:
int SourceIndex = ApplicationOutputPath.IndexOf(Path.DirectorySeparatorChar + “Source”);

So it detects MY root path instead of the project sub folder Source!

So, don’t use the Source string in your root folder!

So the actual fix, if you have a sub directory called Source in your path, is to change the line in UEBuildTarget.cs in function CreateModule:

From :
int SourceIndex = ApplicationOutputPath.IndexOf(Path.DirectorySeparatorChar + “Source”);

int SourceIndex = ApplicationOutputPath.LastIndexOf(Path.DirectorySeparatorChar + “Source” + Path.DirectorySeparatorChar);

Now the binaries folder is created and populated with the proper output!

This bug is so annoying. It just happens randomly, one build it loads up the project fine, the next it has no idea where your project is and you have to start over completely from scratch.

I’ve had this a few times as well. On some projects I’ll receive this error. I’ll then create a new project, and it works fine. shrug

Hi guys,

I had this error when i added some test class code from the menu.
There was a message “successfully added code to the project”.

Then i exited the editor later without thinking about this.

When i launched the project again the editor tried to find the compiled dll (i think) for the game code i added earlier but it failed.

Open your solution in VS2013 and compile the game code (not the entire solution !), this will generate the dll that the editor expects when he loads the project.

I launched the editor again and it loaded fine, i found my new actor in the class list and i could place it into the scene.

Still no answer on a fix for this? There is a hack in this thread that will work, but seriously, this is a pretty major bug and deserves some response, Epic?

If your root folder contains the string “Source” you need the fix I submitted to epic, they are supposed to have it integrated in the master branch…

Yup I’ve tried that, compiled “DebugGame”. Nada.

Every time u change great this in your code, u need to exit the Editor, and rebuild your Project with Development Editor configuration, and then open the editor. The buttom “compile” on editor works just if u make changes in the code inside functions that already exists.