x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

"ModuleManager: Unable to load module" during project startup

I get the error when starting the project

LogLinux: Warning: dlopen failed: ../Unreal_project/Binaries/Linux/libUE4Editor-Unreal_Project.so: undefined symbol: _ZNK9Zeptomoby10OrbitTools7cEcBase8ToStringEv Warning: ModuleManager: Unable to load module ../Unreal_project/Binaries/Linux/libUE4Editor-Unreal_Project.so because the file couldn't be loaded by the OS.

IMHO it's not a OS error as the symbol referring to a ThirdParty library which obviously is not correctly loaded. Here's the code of my Unreal_Project.build.cs

 using UnrealBuildTool;
 using System.IO;
 
 public class Unreal_Project : ModuleRules
 {
     private string ModulePath
     {
         get { return ModuleDirectory; }
     }
 
     private string ThirdPartyPath
     {
         get { return Path.GetFullPath(Path.Combine(ModulePath, "../../ThirdParty/")); }
     }
     
     public Unreal_Project(ReadOnlyTargetRules Target) : base (Target)
     {
     
     PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "HTTP", "UMG", "Slate", "SlateCore" });
         // Uncomment if you are using Slate UI
         PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore", "HTTP" });
 
         // Uncomment if you are using online features
         // PrivateDependencyModuleNames.Add("OnlineSubsystem");
         // if ((Target.Platform == UnrealTargetPlatform.Win32) || (Target.Platform == UnrealTargetPlatform.Win64))
         // {
         //        if (UEBuildConfiguration.bCompileSteamOSS == true)
         //        {
         //            DynamicallyLoadedModuleNames.Add("OnlineSubsystemSteam");
         //        }
         // }
         LoadLibraries(Target);
     }
 
     public bool LoadLibraries(ReadOnlyTargetRules Target)
     {
        bool isLibrarySupported = false;
        
         if (Target.Platform == UnrealTargetPlatform.Win64)
         {
       isLibrarySupported = true;
         }
         
         if (Target.Platform == UnrealTargetPlatform.Linux)
         
         {
       isLibrarySupported = true;
                   
         //CSpice
         PublicIncludePaths.Add(Path.Combine(ThirdPartyPath, "cspice/include"));
         PublicAdditionalLibraries.Add(Path.Combine(ThirdPartyPath, "cspice/lib/cspice.a"));
         PublicAdditionalLibraries.Add(Path.Combine(ThirdPartyPath, "cspice/lib/csupport.a"));
         
         //orbitTools
         PublicAdditionalLibraries.Add(Path.Combine(ThirdPartyPath, "orbitTools/lib/libcore.a"));
         PublicAdditionalLibraries.Add(Path.Combine(ThirdPartyPath, "orbitTools/lib/liborbit.a"));
         PublicIncludePaths.Add(Path.Combine(ThirdPartyPath, "orbitTools/core"));
         PublicIncludePaths.Add(Path.Combine(ThirdPartyPath, "orbitTools/orbit"));
 
         System.Console.WriteLine("ThirdParty Libraries for Linux loaded");
         }
         return isLibrarySupported;
     }
 }

This specific symbol should be part of either the orbitTools/lib/libcore.a or orbitTools/lib/liborbit.a The compiler works correctly and also the message "ThirdParty Libraries for Linux loaded" is shown at the log. So the compiler goes into the correct if loop. If I comment out either the PublicIncludePaths.Add or PublicAdditionalLibraries.Add the compiler will complain, so the libraries must be loaded when compiling. But as the symbol is refering to something from these additional libraries I guess it's not correctly loaded. The windows version works!!!

 using UnrealBuildTool;
 using System.IO;
 
 public class Unreal_Project : ModuleRules
 {
     private string ModulePath
     {
         get { return ModuleDirectory; }
     }
 
     private string ThirdPartyPath
     {
         get { return Path.GetFullPath(Path.Combine(ModulePath, "../../ThirdParty/")); }
     }
     
     public Unreal_Project(TargetInfo Target)
     {
         PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "HTTP", "UMG", "Slate", "SlateCore" });
 
         // Uncomment if you are using Slate UI
         PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore", "HTTP" });
 
         // Uncomment if you are using online features
         // PrivateDependencyModuleNames.Add("OnlineSubsystem");
         // if ((Target.Platform == UnrealTargetPlatform.Win32) || (Target.Platform == UnrealTargetPlatform.Win64))
         // {
         //        if (UEBuildConfiguration.bCompileSteamOSS == true)
         //        {
         //            DynamicallyLoadedModuleNames.Add("OnlineSubsystemSteam");
         //        }
         // }
 
         LoadLibraries();
     }
 
     public void LoadLibraries()
     {
         //CSpice
         PublicIncludePaths.Add(Path.Combine(ThirdPartyPath, "cspice/include"));
         PublicAdditionalLibraries.Add(Path.Combine(ThirdPartyPath, "cspice/lib/cspice.lib"));
         PublicAdditionalLibraries.Add(Path.Combine(ThirdPartyPath, "cspice/lib/csupport.lib"));
 
         //orbitTools
         PublicAdditionalLibraries.Add(Path.Combine(ThirdPartyPath, "orbitTools/x64/Release/orbitTools.core.lib"));
         PublicAdditionalLibraries.Add(Path.Combine(ThirdPartyPath, "orbitTools/x64/Release/orbitTools.orbit.lib"));
         PublicIncludePaths.Add(Path.Combine(ThirdPartyPath, "orbitTools/core"));
         PublicIncludePaths.Add(Path.Combine(ThirdPartyPath, "orbitTools/orbit"));
 
 
         System.Console.WriteLine("Libraries loaded");
     }
 }


I tried several thing, followed the instructions of Unreal Wiki and Transition to UE4.16 (btw. the windows code is working on UE4.16.3 even without these modifications.

I'm using Ubuntu 16.04 and UE4.17.2.

Product Version: UE 4.17
Tags:
more ▼

asked Sep 29 '17 at 01:01 PM in Linux

avatar image

Geekazoid
13 6 6 7

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Look where symbol you're referring to (_ZNK9Zeptomoby10OrbitTools7cEcBase8ToStringEv, or in a demangled form, Zeptomoby::OrbitTools::cEcBase::ToString() const) is defined (you can use nm to examine .a files). If it's not defined in any of .a files you're linking in but present in its sources, the visibility of the symbol may need to be changed.

As for "could not be loaded by the OS" - it is a generic message whenever dlopen() fails. The engine doesn't (and cannot) analyze the details why dlopen() failed (it could be due to a missing system or a third party library or due to exhausting some system limit like DTV_SURPLUS etc) - from its POV it is an external error even if in your case it was caused by the user.

more ▼

answered Sep 29 '17 at 01:09 PM

avatar image

RCL STAFF
2.7k 59 6 88

avatar image Geekazoid Sep 29 '17 at 01:47 PM

Many thanks that did the trick... actually it just came to my mind that I have commented this function from the thirdparty source of the library on the linux version as its using some code which is dedicated to windows only... Looks like I haven't properly commented out this Zeptomoby::OrbitTools::cEcBase::ToString() so it was kinda still there but definitely not correctly defined. I remove it also from the .h file and now it works.

So actually it was not an issue of the loading/linking of additional libraries... which is good, mean the project .Build.cs is correct. Now I just need to adjust it to also run on windows :)

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question