Source Fails to Build

Hi. I am attempting to perform the final step to build Unreal 4 using the source code. When I try to Build the UE4 target in UE4.sln in Visual Studio 2013 Express, the process errors out after a couple of minutes with the following complaint: “Could not write output file ‘Unreal 4 Source\Engine\Intermediate\Build\BuildRules\UE4Rules.dll’ – The process cannot access the file because it is being used by another process.”

I have restarted my machine, and also deleted the file this line mentions (in hopes of getting a different and less weird error). Building the UE4 target re-built the object and generated the same error as before. I have also tried running the installer as an admin - to no avail, sadly.

Note: my operating system is Windows 7 Pro 64-bit SP1.

Has anyone else encountered this issue? Please help.

Forgot to establish: the machine I am working on is not and will not be connected to the internet.

Hi. Have you tried deleting the entire intermediate directory?

Hey -

Which version of the engine are you trying to install? If you are using 4.10.x or one of the 4.11 previews can you try building with Visual Studio 2015 instead? Do you get the same error if you use VS Community rather than Express? Also let me know if teak421’s suggestion of deleting the intermediate folder and then trying to compile helps.

Cheers

Heya. I just tried this. the UE4 file under Engine fails to load in Visual Studio if I remove the Intermediate directory.

Unfortunately, I can’t say which I downloaded because I simply cloned the repository from Git (opened Git, selected “clone”, then selected Unreal Engine.) I want to say 4.10.x. This is actually the second time I cloned the repository, the first also being unsuccessful due to technical issues (which have since been resolved)with the downloading computer. It may be working off of an old selection if that is a thing. Is it possible for me to tell a version from the files I have on my computer?

In the meantime. I’m going to try to acquire Visual Studio 2015 Community and see if that fixes my problem. I’ll get back to you on whether or not it works.

Also: I did try teak421’s suggestion, but it caused the UE4 file under the Engine folder to fail to load in VS.

Thanks for responding!

I got VS 2015 Community and tried to build again. I am receiving the same errors as before:

Error 1: MSB3073 The command “…\Build.bat UE4Editor Win64 Development -waitmutex” exited with code -1.

Error 2: CS0016 Could not write to output file ‘Unreal 4 Source\Engine\Intermediate\Build\BuildRules\UE4Rules.dll’ – ‘The process cannot access the file because it is being used by another process.’

Hey -

It seems like something else running is preventing the compiler from completing. Can you let me know if restarting your computer and then attempt to build before loading any other programs? Also, The CS0016 error that you posted seems to be an issue with the environment variables. Can you check that the environment variables are set poperly? This can be done by finding “MyComputer” or “Computer” in the start menu, rick clicking and selecting Properties. In the window that appears, select “Advanced system settings” on the left hand side. In the System Properties window under the Advanced Tab, click the button for Environment Variables… In the System variables box select the variable for “Path” and choose edit.

Cheers

,

Would it be possible for you to explain what the correct setting should be? I copy/pasted the field into notepad and wasn’t able to find any sort of reference to Unreal.

Also, I just attempted to compile immediately after boot. No luck… BUT! I tried something bazaar on a whim to see if it would work, and it did, strangely, as far as I can tell. I found “UE4Rules.dll” in windows explorer and deleted it. Then, I tried to compile the code. After the compiler created “UE4Rules.dll”, I immediately renamed it. I did so again after the compiler created the file a second time. This actually allowed the build to succeed. I even started a new project. I also found out that the version I am compiling is actually 4.11, not 4.10.

Here is a detailed description of what we are seeing on our end:

  1. Project: ShaderCompileWorker creates UE4Rules.dll.
  2. Project: UE4

2.1. Creates UE4Rules.dll when output says “Creating makefile for UE4Editor”.

2.1.1. Note: if we rename UE4Rules.dll before this completes, we build successfully as I talked about before.

2.2. When the output says “Creating makefile for UnrealHeaderTool”, we get the errors we mentioned before (CS0016) (once again, unless we rename UE4Rules.dll before we get to this line).

I hope this is helpful. I had to be extremely quick to rename the files in time for this to work.

Are you using the Release branch from GitHub to acquire the source code? If so then it explains why you are getting 4.11 and you will need to get the 4.10 branch specifically to get the source code for 4.10.3.

Just to confirm, once you’ve downloaded and extracted the zip file you ran Setup.bat and GenerateProjectFiles.bat and the error is occurring when building UE4.sln inside Visual Studio, is this all correct? When building in VS for the first time, be sure that the Solution Configuration and Solution Platform are set to Development Editor and Win64 respectively.

Well, acquiring 4.10.3 will take a while with my current setup. I might as well work in 4.11 until I can the older version.

I ran Setup.bat on a separate computer, which has an internet connection (since Setup.bat downloads ~4GB of data), and moved everything over to the non-connected machine. The error is indeed occurring when building UE4.sln in Visual Studio. The Solution Configuration and Solution Platform are/were respectively Development Editor and Win64 at the time of first compile attempt and all subsequent attempts.

Hey -

I have tried to reproduce the build failure you mentioned but have not had any luck doing so yet. I wanted to confirm the steps I’ve tried to see if they match what you used to initiate the build process.

  1. First I downloaded the .zip file from GitHub, extracted it and ran Setup.bat.
  2. I then zipped the folder back up and copied it to another computer
  3. Unzipping the folder on computer2, I then ran GenerateProjectFiles.bat
  4. After opening the UE4.sln file I attempted to build the UE4 solution

If these steps don’t match what you’ve been doing, please let me know what exactly you’ve tried so that I can follow along.

That matches my process. I’m thinking it might have just been a botched download or write, especially because I discovered that I can’t create C++ projects even when I use the weird trick I mentioned above.

Also: I have since convinced the necessary people to allow me to connect the system to the internet for a brief time to install Unreal Engine 4 via the download/installer, but it isn’t really the optimal solution for our development environment and we would prefer to go with the source-building approach of possible. I will attempt a new download sometime soon to see if that solves my problem, and then I will get back to you on whether or not it worked.

Thanks for your help.

Hey -

I just wanted to touch base and see if you’ve had the chance to try downloading and building the source again? Let me know if you have any further questions.

Hi ,

We have not heard back from you in a few days, so we are marking this post as Resolved for tracking purposes. If you are still experiencing the issue you reported, please respond to this message with additional information and we will offer further assistance.

Thank you.

I apologize for not getting back to you until now. I have been working on an Unreal Engine 4 project since having installed the engine with the downloader. No need to worry about me for a while. I will definitely post my results here when I do get around to trying to build from source again (probably in a few weeks), for the benefit of anyone else who may be having this problem.

Could it be in Registry you have more than 1 items under \HKCU\Software\Epic Games\Unreal Engine\Builds?

Hey everyone,

Just wanted to say we have just run into this problem, and the cause was, to put it short, that source file timestamps were in the future, catching UBT in a perpetual “target not up to date” loop.

Steps to reproduce:

  1. Have the system clock incorrectly point to the future (for whatever reason, e.g. failing BIOS battery).
  2. Download UE4 source.
  3. Set system clock to the correct time.
  4. Observe the problem.

The fix is to either reset the timestamps on the files in the working copy to the present (for instance using the touch Bash command), or to re-download everything, this time with the system clock set correctly.

HTH,

This is the right answer. Happened to me as well.