This document serves as a lean and mean guide to setting up the Linux x86 Cross-Compile Toolchain for Windows. The process is already mostly animated by Epic but the existing documentation is a bit verbose.

Requirements

Installation

  1. Open the automated PowerShell script in your browser.
  2. Open up an instance of PowerShell as an Administrator. You can do this by searching for PowerShell in your start menu, right clicking it, and clicking Run As Administrator.
  3. In your browser, copy the entire script to your clipboard. You can do this by hitting Control+A and then Control+C.
  4. Paste the script into Powershell using Control-V, and then hit Enter to execute the script.
  5. PowerShell will then download and automatically install the Linux x86 Cross-Compile Toolchain. This will take some time. The download is around 200MB.
  6. When the PowerShell script is done, it will look something like this. If you get a big red error that looks something like this, you did not run PowerShell as an administrator in Step 2. Please go back to Step 2 and repeat the process. The script will ask you if you would like to overwrite and replace files if you run it a second time, please do. Go to jail, do not pass go, do not collect $200.
  7. You can then close the window, PowerShell is no longer needed.
  8. With the Linux x86 Cross-Compile Toolchain installed, you need to download the Linux UE4 dependencies. To do this, go to your Engine build where you should have a batch file called Setup.bat that you used to initially set up your Engine. Go ahead and simply run this again. If it asks you if you want to overwrite changes you have, I recommend saying Yes as you can always rebuild those files later if needed, but saying No should also work. Setup.bat will now download all the Linux dependencies you need.
  9. Regenerate your project’s Visual Studio project files by right-clicking your project’s .uproject file and choosing “Generate Visual Studio Project files”. This is the same as Step 6 in the “Convert your BP Project to a C++ Project” tutorial.

Verify It Works By Compiling for Linux x86

  1. Open up your project’s Visual Studio solution file. This is the .sln file that you opened in the “Convert your BP Project to a C++ Project” tutorial if you came from there.
  2. Make sure your project is selected in the Solution Explorer
  3. You should now see the Linux option under the Platforms drop down. Select it. If you don’t see it, then your toolchain is not installed correctly, you did not run Setup.bat after installing the toolchain to pull down the Linux dependencies, or you did not regenerate your project files.
  4. Change the Build Configuration drop down to “Development”. This tells Visual Studio to build the Linux binary for your packaged game.
  5. Right-click your project in the Solution Explorer and hit Build.
  6. Your build should succeed without issues, unless you have some custom code causing problems on Linux.
  7. Now you can package Linux x86 builds of your game using the UE4 editor! To do this, use File -> Package Project -> Linux, and the rest is the same as packaging for Windows.

This document covers how to convert a Blueprint Only project to a C++ project without writing any C++ code using Windows. This isn’t intended to fold down your Blueprint Logic to C++, it is meant only to wrap your Blueprint Project with a C++ project. Some plugins and engine features require a C++ project and this is an easy way to still work in Blueprints but not be constrained by this limitation.

Requirements

Convert Process

  1. Open Your Project in the Unreal Engine 4 Editor.
  2. Open up the New C++ Class Dialog by using File -> New C++ Class…
  3. Choose a new “None” class and hit “Create Class.”
  4. You may be prompted with a warning message about being able to compile the game module You can safely ignore this and hit No.
  5. Close any pop-ups, warnings, or success notifications, then close the Editor
  6. Navigate to your project’s folder, right click your project’s .uproject file, and click “Generate Visual Studio project files.”
  7. Open your project in Visual Studio by double-clicking your project’s .sln file.
  8. Visual Studio should load. If it asks you what theme you would like, pick what looks best to you, all screenshots here will be using the Dark theme. You should be looking at something like this.
  9. Find and select your project in Visual Studio’s Solution Explorer.
  10. Set the build configuration drop down to “Development Editor”
  11. Right-click your project in the Solution Explorer and click Build.
  12. This should result in your project being compiled successfully with zero errors.
  13. Set the build configuration drop down to “Development”
  14. Right-click your project in the Solution Explorer and click Build, again.
  15. This build will take much longer, on the order of several minutes. This should result in your project being compiled successfully with zero errors though, again.

Finished

Your Blueprint Project is now a C++ Project. You are able to open up your project just as before and nothing has changed in terms of your project’s functionality, but you are now able to use Engine features that require C++ Projects, such as third-party plugins, Subsystem integrations, dedicated servers, etc. You shouldn’t have to open Visual Studio ever again unless you do some C++ code, but you still have to keep Visual Studio installed.

I made a custom WASD keycap set using the templates over at WASD Keyboards for my Das Keyboard.

You can get the source vector files I made here on my github.

Click for full image.

UE4 Keyboard Shortcuts

Sample Print 1

Sample Print 2

If you plan on compiling Unreal Engine 4 across multiple platforms and don’t want to have to deal with adding all the related dependencies per platform to your source control or making sure they are all in sync across platforms or simply don’t want to run Setup.sh multiple times, you can choose to fetch dependencies for all platforms from a single machine. On Windows, the easiest thing to do is to edit Setup.bat and find the line that reads:

.\Engine\Binaries\DotNET\GitDependencies.exe --prompt %*

and go ahead and change this to:

.\Engine\Binaries\DotNET\GitDependencies.exe --all --prompt %*

I haven’t looked into running this on “Not Windows” but as long as you find a way to run GitDependencies with the –all argument, it will fetch all dependencies for all platforms. Setup.sh would be your starting point. You should also still run Setup.sh on Linux/OSX hosts as there are non-Epic dependencies that need updated, for instance clang, Mono, Qt, GTK, and others, that you also wouldn’t ever put on your source control anyway.

Epic left in some commented code in the selection outline shader that provides marching ants for occluded parts of your outlines. Made a short video about how to enable it.