
Unreal Engine: QuickStart in Qt Creator under Arch Linux
- Tutorial
Introduction
In March 2015, Epic Games turned to the Open Source community, providing free access to its Unreal Engine version 4 (setting a limit on profit from using the engine at $ 3,000 per quarter). Moreover, back in 2014, the company said that supporting free operating systems, in particular Linux, was one of its priority tasks.

It is worth noting that these words did not become an empty phrase, and today the engine works quite confidently in the Linux environment. There is a sufficient amount of official documentation telling about how to install and configure the engine in the environment of this OS.
However, despite the apparent transparency of the process of deploying a working environment, there are a number of small but unpleasant nuances that make life difficult for penguin fans. Under the cut, a short and free description of the features of the installation of the engine, which the author encountered, is designed to solve some of the difficulties that beginners encounter.
1. The source data
So, we have a computer (CPU: Intel Core i7-2600K, RAM: 16Gb, Video: GeForce 580GTX), with the Arch Linux distribution as the operating system.
There is a package for this distribution in the custom AUR repository . Judging by the comments on the package, it is going to work and, in principle, you can use it to install the engine. Just wait until the package collector clones the repository for a long time. With a total release branch size of 1.5-2 GB, the cloning process freezes by 81%, pulling about four gigabytes from the network. I did not have the patience to wait for the end of this process.
Therefore, we will go the other way, collecting the engine from the source without wrapping it in a package, motivating it with the fact that the installation of the engine is generally not required. Make sure that the following packages are installed on the system:
- clang - C / C ++ frontend to LLVM compiler
- python - Python interpreter
- qt4 - cross-platform framework for C / C ++ development
- sdl2 - a cross-platform library for working with multimedia
- icu - a component of Unicode libraries for internationalizing applications
- mono - a free implementation of .Net Framework
- xdg-user-dir - "control" user directories like "Documents", "Images", etc. as part of the X Window System
- git - client for working with the version control system of the same name
2. Getting the Unreal Engine source
This procedure is described in detail on the official website of Epic Games . First you need to get an Epic Games account , as the engine source code repository is private. In addition, you will need to create an account on Github , for which the aforementioned office will give access to the repository. There is nothing especially to comment here: the procedure is quite simple and understandable.
Having gained access to the repository, we create a directory in the file system where the engine will be located, go to it and say a spell and wait for the engine’s release branch to load. This process is not faster than using the Aurovsky PKGBUILD.
$ git clone https://github.com/EpicGames/UnrealEngine.git -b release
3. Engine assembly: rake race
Having received the sources, we go to the catalog observing such a picture. Assembly instructions are given on the official website in the documentation and also in the official wiki . However, in the case of Arch Linux, you should not rush to follow this instruction, since the wiki has an alarming replica
$ cd UnrealEngine
$ ls -la
итого 80
drwxr-xr-x 6 maisvendoo users 4096 ноя 4 18:02 .
drwxr-xr-x 27 maisvendoo users 4096 ноя 5 15:29 ..
-rw-r--r-- 1 maisvendoo users 382 ноя 4 17:50 .editorconfig
drwxr-xr-x 11 maisvendoo users 4096 ноя 4 17:50 Engine
-rw-r--r-- 1 maisvendoo users 418 ноя 4 17:50 GenerateProjectFiles.bat
-rwxr-xr-x 1 maisvendoo users 241 ноя 4 17:50 GenerateProjectFiles.command
-rwxr-xr-x 1 maisvendoo users 715 ноя 4 17:50 GenerateProjectFiles.sh
drwxr-xr-x 8 maisvendoo users 4096 ноя 4 18:01 .git
-rw-r--r-- 1 maisvendoo users 511 ноя 4 17:50 .gitattributes
-rw-r--r-- 1 maisvendoo users 3732 ноя 4 17:50 .gitignore
-rw-r--r-- 1 maisvendoo users 195 ноя 4 17:50 LICENSE.md
-rw-r--r-- 1 maisvendoo users 9472 ноя 4 17:50 README.md
drwxr-xr-x 4 maisvendoo users 4096 ноя 4 17:50 Samples
-rw-r--r-- 1 maisvendoo users 1304 ноя 4 17:50 Setup.bat
-rwxr-xr-x 1 maisvendoo users 208 ноя 4 17:50 Setup.command
-rwxr-xr-x 1 maisvendoo users 1345 ноя 4 17:50 Setup.sh
drwxr-xr-x 28 maisvendoo users 4096 ноя 4 17:50 Templates
-rw-r--r-- 1 maisvendoo users 269 ноя 4 17:50 UE4Games.uprojectdir
Arch Linux users should try building the Editor using the Debug profile if Development (default) does not work
officially offering us to use a nasty crutch in the form of an assembly of the debug version of the editor. At the same time, it is completely forgotten that in addition to the editor, you should also build a shader compiler and several other auxiliary utilities that are included with the engine. An attempt to build with the parameters proposed by the developer will be interrupted with a message of the form This problem is known to the unreal-engine package maintainers in AUR, for which they suggest applying a patch fixing this to the sources. The problem is related to changing the gcc and clang build parameters in Arch Linux, as mentioned for example here
/usr/bin/ld: /mnt/data/install/ue4-test/Engine/Source/ThirdParty/FreeType2/FreeType2-2.6/Lib/Linux/x86_64-unknown-linux-gnu/libfreetype.a(ftlzw.c.o): relocation R_X86_64_32S against `.text' can not be used when making a shared object; перекомпилируйте с параметром -fPIC
/usr/bin/ld: /mnt/data/install/ue4-test/Engine/Source/ThirdParty/zlib/v1.2.8//lib//Linux/x86_64-unknown-linux-gnu/libz.a(uncompr.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; перекомпилируйте с параметром -fPIC
/usr/bin/ld: final link failed: Раздел, непредставимый для вывода
clang-5.0: error: linker command failed with exit code 1 (use -v to see invocation)
ERROR: UBT ERROR: Failed to produce item: /mnt/data/install/ue4-test/Engine/Binaries/Linux/CrashReportClient
Total build time: 196,17 seconds (Local executor: 0,00 seconds)
make: *** [Makefile:252: CrashReportClient-Linux-Shipping] Ошибка 5
SSP and PIE are now enabled in gcc (commit) and clang (commit) in the stable repos.
These changes will make it harder to exploit potential security holes in binaries built with these compilers.
Some discussion about this can be found on the arch-dev-public mailing list (subject "Changing compilation flags").
Enabling Position Independent Executables (PIE) breaks ABI-level compatibility for compiled engine libraries and leads to the layout errors mentioned above. Accordingly, for normal assembly, turn off this option.
To change the settings you need to pick UBT scripts . The engine uses its own build system, the scripts of which are written in C #. Open the file Engine / Source / Programs / UnrealBuildTool / Platform / Linux / LinuxToolChain.cs , adding the necessary settings to it. To illustrate the changes, I will cite the exhaust git diff The -Wno-unused-result option turns off warnings about unused results returned by functions
--- a/Engine/Source/Programs/UnrealBuildTool/Platform/Linux/LinuxToolChain.cs
+++ b/Engine/Source/Programs/UnrealBuildTool/Platform/Linux/LinuxToolChain.cs
@@ -377,6 +377,9 @@ namespace UnrealBuildTool
Result += " -Wno-invalid-offsetof";
// we use this feature to allow static FNames.
Result += " -Wno-gnu-string-literal-operator-template";
+// disable unused result's warnings
+Result += " -Wno-unused-result";
@@ -402,6 +405,7 @@ namespace UnrealBuildTool
Result += " -fno-inline";
Result += " -fno-omit-frame-pointer";
Result += " -fstack-protector";
+ Result += " -fno-pie";
@@ -588,6 +592,8 @@ namespace UnrealBuildTool
Result += " -Wl,--disable-new-dtags";
+ Result += " -nopie";
+ Result += " -Wno-unused-command-line-argument";
With the -fno-pie and -nopie switches, we disable PIE for the compiler and linker. The -Wno-unused-command-line-argument switch disables the warning about unknown command line parameters.
Before starting the assembly, create a symlink warning the error "xlocale.h is not found". The described problems are solved in AUR by applying a series of patches to the sources, and, in principle, no one forbids the reader to go this way. After the preparation described above, we execute the script. The script downloads and collects the necessary third-party libraries. Next, we run a script that activates the Unreal build system, generating files for building projects using make, cmake, qmake, MS Visual Studio, KDevelop, and CodeLite. At the end of the script with a clear conscience, we give the command
$ sudo ln -s /usr/include/locale.h /usr/include/xlocale.h
$ ./Setup.sh
$ ./GenerateProjectFiles.sh
$ make
I note that you should not use the -j switch to specify the number of collecting threads. The Makefile is generated taking into account the parallelization of the assembly to all threads available to your machine.
The assembly process will take place without errors and will take some time on my system is about 40 minutes, collect the same engine and the debug option
[1367/1372] Link libUE4Editor-UE4Game.so
[1368/1372] Link libUE4Editor-Advertising.so
[1369/1372] Link libUE4Editor-BlankModule.so
[1370/1372] Link libUE4Editor-IPC.so
[1371/1372] Link libUE4Editor-BlankPlugin.so
[1372/1372] Link libUE4Editor-XGEController.so
Total build time: 2560,27 seconds (Local executor: 2481,53 seconds)
$ make DebugSet
4. Create QuickStart in Qt Creator
We start the UE4 editor we have assembled. We patiently wait until the shaders are compiled (the compilation result is cached and the next launch will be much faster). At the end of the compilation, create a new project in C ++. Choose the path where the project is located, give it the name QuickStart and click the green CreateProject button. We wait while the editor generates the project files. At the end of the generation, the editor closes. On Windows, if you have MS Visual Studio, you will open this particular IDE, offering to start coding. In archa nothing will happen. Therefore, we follow the path that we indicated when creating the project and see what OK was generated there , the editor created the source code (Source directory) and a number of project files, including the * .pro script for qmake. We launch Qt Creator and open QuickStart.pro in it.
$ cd Engine/Binaries/Linux
$ ./UE4Editor

$ ls -l
итого 4728
-rw-r--r-- 1 maisvendoo users 1999696 ноя 7 00:06 CMakeLists.txt
drwxr-xr-x 2 maisvendoo users 4096 ноя 7 00:05 Config
drwxr-xr-x 2 maisvendoo users 4096 ноя 7 00:05 Content
drwxr-xr-x 4 maisvendoo users 4096 ноя 7 00:06 Intermediate
-rw-r--r-- 1 maisvendoo users 16777 ноя 7 00:05 Makefile
-rw-r--r-- 1 maisvendoo users 350169 ноя 7 00:06 QuickStartCodeCompletionFolders.txt
-rw-r--r-- 1 maisvendoo users 14860 ноя 7 00:06 QuickStartCodeLitePreProcessor.txt
-rw-r--r-- 1 maisvendoo users 60261 ноя 7 00:06 QuickStartConfig.pri
-rw-r--r-- 1 maisvendoo users 22114 ноя 7 00:06 QuickStartDefines.pri
-rw-r--r-- 1 maisvendoo users 908626 ноя 7 00:06 QuickStartHeader.pri
-rw-r--r-- 1 maisvendoo users 220484 ноя 7 00:06 QuickStartIncludes.pri
-rw-r--r-- 1 maisvendoo users 59 ноя 7 00:05 QuickStart.kdev4
-rw-r--r-- 1 maisvendoo users 17091 ноя 7 00:06 QuickStart.pro
-rw-r--r-- 1 maisvendoo users 722630 ноя 7 00:06 QuickStartSource.pri
-rw-r--r-- 1 maisvendoo users 224 ноя 7 00:05 QuickStart.uproject
-rw-r--r-- 1 maisvendoo users 462378 ноя 7 00:06 QuickStart.workspace
drwxr-xr-x 3 maisvendoo users 4096 ноя 7 00:05 Source

In the window that appears, click "Configure Project." Configuring Qt Creator is described in detail in the official documentation of the engine. I will dwell only on some points of the setup and give screenshots of my settings
Configuring the debug assembly

Configuring the release assembly

Configuring the launch

After all the settings are completed, press Ctrl + R and start the project. We

answer in the affirmative. The engine will think a little more, compile the shaders and in the end we get the project, ready to work on the QuickStart exercise from the official documentation .

Instead of a conclusion
With proper project setup, the next trick is possible. In an open project, click F10

Yeah, the availability of the engine source code gives us the opportunity not only to debug the game code, but also to trace the engine code, which is sometimes required to find out the causes of errors. In this Epic Games looks much more friendly to its users than some other offices that also provide their engine for free.