I am trying to get UE4 built using clang on Windows and I am getting an error when trying to build it.
1>------ Build started: Project: UE4, Configuration: Linux_Development_Editor Win32 ------
1> cmd.exe /C "cmd.exe /C "C:\Development\Epic Games\Source\UnrealEngine\Engine\Intermediate\Build\Linux\x86_64-unknown-linux-gnu\UE4Editor\Development\FixDependencies.bat" && echo "" >> "C:\Development\Epic Games\Source\UnrealEngine\Engine\Intermediate\Build\Linux\x86_64-unknown-linux-gnu\UE4Editor\Development\UE4Editor.link" && copy /b "C:\Development\Epic Games\Source\UnrealEngine\Engine\Intermediate\Build\Linux\x86_64-unknown-linux-gnu\UE4Editor\Development\UE4Editor.link" +,,"
1> Performing 125 actions (4 in parallel)
1> [1/125] Link libUE4Editor-DesktopPlatform.so
1> C:\Programs\v4_clang-3.5.0_ld-2.24_glibc-2.12.2\toolchain\bin\x86_64-unknown-linux-gnu-ld.exe: cannot find -lLND
1>clang++.exe : error : linker command failed with exit code 1 (use -v to see invocation)
1> -------- End Detailed Actions Stats -----------------------------------------------------------
1>ERROR : UBT error : Failed to produce item: C:\Development\Epic Games\Source\UnrealEngine\Engine\Binaries\Linux\libUE4Editor-DesktopPlatform.so
1> Cumulative action seconds (4 processors): 0.00 building projects, 0.00 compiling, 0.00 creating app bundles, 0.00 generating debug info, 0.15 linking, 0.00 other
1> UBT execution time: 23.73 seconds
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.MakeFile.Targets(38,5): error MSB3073: The command "..\..\Build\BatchFiles\Build.bat UE4Editor Linux Development" exited with code -1.
========== Build: 0 succeeded, 1 failed, 1 up-to-date, 0 skipped ==========
This worked prior to upgrading to 4.7.4.
I can’t find any information on this and I suspect that this might be an issue. Can anyone verify whether they are experiencing the same.
Are you referring to building for Linux in Visual Studio? Have you build the editor for Windows first before building for Linux? Did you run the Setup.bat file prior to running GenerateProjectFiles.bat? Are you using the 4.7 branch from github or the releases branch?
Let us know if there is any other information you can think of that would help us investigate this issue.
Yes building for Linux in VIsual Studio … here are the steps I followed.
- Installed clang to “C:\Programs\v4_clang-3.5.0_ld-2.24_glibc-2.12.2”
- Set up my LINUX_ROOT environment variable to point to the path above
- Cloned the latest release version from GITHUB
- Ran Setup.bat
- Ran GenerateProjectFiles.bat
- Open UE4.sln file in Visual Studio
- Set my target to Development_Editor
- Built the 64BIT version of the Development_Editor for Window
- Try to build the same project for Linux … I get the error above
I am also getting this error when attempting to package for Linux.
MainFrameActions: Packaging (Linux): UnrealBuildTool: C:\Development\Gobbo Games\Kaboom Arena\KaboomArena\Intermediate\Build\Linux\x86_64-unknown-linux-gnu\KaboomArena\Shipping\KaboomArena\KaboomArena.h(4,10) : fatal error: UTF-16 (LE) byte order mark detected in 'C:\Development\Gobbo Games\
MainFrameActions: Packaging (Linux): Kaboom Arena\KaboomArena\Source\KaboomArena\KaboomArena.h', but encoding is not supported
MainFrameActions: Packaging (Linux): UnrealBuildTool: #include "C:\Development\Gobbo Games\Kaboom Arena\KaboomArena\Source\KaboomArena\KaboomArena.h"
MainFrameActions: Packaging (Linux): UnrealBuildTool: ^
MainFrameActions: Packaging (Linux): UnrealBuildTool: 1 error generated.
You are trying to cross-compile the Linux editor - is that the intent? This makes sense during the development, but since you mentioned packaging later, I am making sure that you want the editor and not the standalone game (which would be “Development” or “Shipping” configurations in Visual Studio).
To cross-compile the Linux editor, one module (LinuxNativeDialogs, needed for DesktopPlatform module) needs to be built natively on a Linux machine and then copied to Windows. This is generally done by running Setup.sh script while on Linux box; I can elaborate on this if needed.
As for the packaging error, seems like clang doesn’t support UTF-16 encoding for source files. Save the affected header (KaboomArena.h) as an UTF-8 or perhaps plain ASCII file (just try opening it in a barebones text editor like notepad and save; also make sure you don’t have non-ASCII characters in that file). This seems to be clang limitation and not ours (e.g. utf-16.c | searchcode ).