You are not logged in.
Pages: 1
Topic closed
I am trying to compile unreal-engine, it worked some time ago, but since few months I got error:
[1970/17816] Compile DisplayClusterConfigurationTypes_Media.cpp
/home/DATA/Projects/ABS/BUILD/unreal-engine/unreal-engine/src/unreal-engine/Engine/Plugins/Runtime/nDisplay/Source/DisplayClusterConfiguration/Private/DisplayClusterConfigurationTypes_Media.cpp:3:9: error: #pragma once in main file [-Werror,-Wpragma-once-outside-header]
#pragma onceAnd of course there is "#pragma" in source. So how others can compile it? It seems that they don't have "-Wpragma-once-outside-header", but I did not set that anywhere.
Offline
Did you have any luck with this? I'm having the same problem.
Offline
Hello, I have a similar issue. I have not solved it yet, but here are some relevant information:
I am manually compiling unreal engine 5.4.4 forked from Github. I tried using make -j1 and ./Engine/Build/BatchFiles/Linux/Build.sh UnrealEditor Linux Development -Progress.
One thing to note, I modified GenericPlatformProcess.cpp to always include <unistd.h> and <sched.h> instead of including them only if PLATFORM_HAS_BSD_TIME (why? some other issue causing unreal engine to crash on startup). I did not have a compile issue before this modification, and as compiling took 4 hours, I have not yet removed the changes to test if compilation works again.
Edit: the same error persist after the change is reverted. Then why did it work the first time? I don't understand either.
Onto the issue, pragma once is basically a cool header guard.
On one hand, I think epic devs must have put pragma once there on purpose. On the other hand, according to https://stackoverflow.com/questions/618 … -main-file, pragma once is supposed to only be used for header files instead of files you need to compile. This makes sense, but why then would the epic devs put pragma once in the file "Engine/Plugins/Runtime/nDisplay/Source/SharedMemoryMediaEditor/Private/ModularFeatures/SharedMemoryMediaInitializerFeature.cpp:3:9"?
Admittedly, the file for which I ran into the same error is different from your file.
Relevant error:
------ Building 6 action(s) started ------
@progress 'Compiling C++ source code...' 17%
[1/6] Link (lld) libUnrealEditor-UserToolBoxCore.so
@progress 'Compiling C++ source code...' 33%
ld.lld: error: undefined symbol: UUserToolBoxBaseBlueprint::Execute()
>>> referenced by Module.UserToolBoxCore.cpp
>>> /home/jc/Games/Unreal-Engine/UnrealEngine-fork/Engine/Plugins/Experimental/UserToolBoxCore/Intermediate/Build/Linux/x64/UnrealEditor/Development/UserToolBoxCore/Module.UserToolBoxCore.cpp.o:(vtable for UUserToolBoxBaseBlueprint)
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
[2/6] Compile SharedMemoryMediaInitializerFeature.cpp
/home/jc/Games/Unreal-Engine/UnrealEngine-fork/Engine/Plugins/Runtime/nDisplay/Source/SharedMemoryMediaEditor/Private/ModularFeatures/SharedMemoryMediaInitializerFeature.cpp:3:9: error: #pragma once in main file [-Werror,-Wpragma-once-outside-header]
#pragma once
Soooo... I can either try just commenting ''#pragma once'' out of the relevant cpp files, or I can try locating where the compiler decided to add -Wpragma-once-outside-header and removing that flag.
I got a feeling that things might break after trying either of these, but I'll get back in another post if anything actually works.
Last edited by burning-archer_451 (2025-12-30 06:21:31)
Offline
Additional maybe useful information: In Engine/Source/Programs/UnrealBuildTool/ToolChain/ClangWarnings.cs, there exist a function GetIntelDisabledWarnings with Arguments.Add("-Wno-pragma-once-outside-header");.
-Wno-pragma-once-outside-header would disable that pragma once warning, and it needs to be added somewhere. Maybe this function has not been called...?
Offline
Mod note: Please don't necro-bump. Closing this old topic.
Inofficial first vice president of the Rust Evangelism Strike Force
Offline
I am manually compiling unreal engine 5.4.4 forked from Github.
That makes this unsuitable for this subboard, please create a new thread in "Programming & Scripting" .
Put cli/progam output in [ code ] [ /code ] tags, see https://bbs.archlinux.org/help.php#bbcode
Last edited by Lone_Wolf (2025-12-30 09:44:13)
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Offline
Pages: 1
Topic closed