5

I'm trying to build my first Unreal C++ project on Linux.

I built the engine from source in accordance with "Linux Quick Start" guide. Then I installed Qt Creator and followed the "How to Set up Qt Creator for UE4" guide.

I successfully set up and ran UE4Editor, and created a new C++ project. Unfortunately when I try running the project it complains:

enter image description here

And when I press "yes" this error message is shown:

enter image description here

Here's the error message from the logs:

ERROR: Building would modify the following engine files:
       
       /media/redacted-disk/UnrealEngine/Engine/Binaries/Linux/Android/UE4Editor.modules
       /media/redacted-disk/UnrealEngine/Engine/Binaries/Linux/Linux/UE4Editor.modules
       /media/redacted-disk/UnrealEngine/Engine/Binaries/Linux/UE4Editor.modules
       /media/redacted-disk/UnrealEngine/Engine/Plugins/2D/Paper2D/Binaries/Linux/UE4Editor.modules
       /media/redacted-disk/UnrealEngine/Engine/Plugins/AI/AISupport/Binaries/Linux/UE4Editor.modules
      ... many more

I tried rebuilding UE4 from IDE, then building again - but the error still persists. Same thing happens if I try starting UE4Editor from the engine files and opening the project from there.

What could cause this error? Why does it even try to rebuild the engine when I'm tring run a project?

Rogach
  • 26,050
  • 21
  • 93
  • 172

2 Answers2

4

I have the following script to add the paths to the engine scripts and binaries to my PATH:

UNREAL_HOME="/path/to/source/of/UnrealEngine"
UNREAL_SCRIPTS="${UNREAL_HOME}/Engine/Build/BatchFiles"
UNREAL_SCRIPTS_LINUX="${UNREAL_HOME}/Engine/Build/BatchFiles/Linux"
UNREAL_BINS="${UNREAL_HOME}/Engine/Binaries/Linux"
PATH="${PATH}:${UNREAL_BINS}:${UNREAL_SCRIPTS}:${UNREAL_SCRIPTS_LINUX}"
export PATH

Then I run UE4Editor '/absolute/path/to/project.uproject' from within the directory of my project.

I never create a project inside the source tree of the engine. Paths should absolutely be different.

I use VS-Code as the IDE. This is what works best from my experience. QT-Creator will work only if you create an include files with lots of #define that are missing from the .pro files created by unreal.

You can configure VS-Code to have an intelli-sense like completion by installing the C# and C/C++ extensions. I had to install mono in order to get OmniSharp working (this is the server than handles the autocompletion for VS-Code). Here is an extract of my VS-Code settings.json file:

"omnisharp.path": "/home/myuser/.vscode/extensions/ms-dotnettools.csharp-1.23.9/.omnisharp/1.37.6/omnisharp/OmniSharp.exe",
"omnisharp.monoPath": "/usr/bin/mono",

You can also install the C++ Helper extensions which is usefull for creating methods, classes, and so on.

fjardon
  • 7,921
  • 22
  • 31
0

In the directory of your project run 'make YOURPROJECTNAMEEditor', then you can run 'open YOURPROJECTNAME.uproject' and it should open.

Alex Mason
  • 385
  • 1
  • 5
  • 11