I need to build Boost in my project for anther library I require. However boost fails to be imported into my project. I modified the tutorials build script to handle a string for the library name (and import_priority
as an attempt to solve the issue).
public bool load_library(string library_name, List<string> import_priority = null)
{
string libraries_path = Path.Combine(ThirdPartyPath, library_name, "Libraries");
string extension = ".dylib";
string pattern = "*" + extension;
if (import_priority != null) {
foreach (string file in import_priority) {
string actual_name = Path.Combine(libraries_path, file + extension);
PublicAdditionalLibraries.Add(actual_name);
}
}
foreach (string file in Directory.GetFiles(libraries_path, pattern)) {
if (import_priority == null || !PublicAdditionalLibraries.Contains(file)) {
PublicAdditionalLibraries.Add(file);
}
}
// Include path
PublicIncludePaths.Add(Path.Combine(ThirdPartyPath, library_name, "Includes"));
Definitions.Add(string.Format("WITH_"+library_name.ToUpper()+"_BINDING={0}", 1));
return true;
}
The error I am getting upon build is as follows:
[2016.03.02-16.33.01:533][ 0]LogMac:Warning: dlopen failed: dlopen(/Users/error/Documents/Unreal Projects/Jetstream/Binaries/Mac/UE4Editor-Jetstream.dylib, 5): Library not loaded: libboost_system.dylib
Referenced from: /Users/error/Documents/Projects/boost_1_60_0/stage/lib/libboost_chrono.dylib
Reason: image not found
[2016.03.02-16.33.01:533][ 0]LogModuleManager:Warning: ModuleManager: Unable to load module '/Users/error/Documents/Unreal Projects/Jetstream/Binaries/Mac/UE4Editor-Jetstream.dylib' because the file couldn't be loaded by the OS.
There are three things that I am gathering from the build error:
-
libboost_chrono.dylib
requireslibboost_system.dylib
-
libboost_system.dylib
cannot be found -
UE4Editor-Jetstream.dylib
cannot be compiled due to the failed import of the first error
My first idea to rectifying the issue was to implement a build import priority ( load_library("Boost", new List{"libboost_system"});
). My idea on why libboost_chrono.dylib
could not be found was simply due to the fact that it was not imported first. I was also hoping that should I import the library first, it would also fix any pathing conflicts. However, this strategy did not work. Unfortunately, beyond giving me the most basic “Not found” error on the planet, I have no idea where it is trying to look for this library.
TL;DR: How do I import Boost?