Manjaro系统下UnrealBuildTool链接assimp库失败求助
Hey there! Let's work through this linking issue with assimp when compiling Carla on your Manjaro system. The key problem here is that Unreal Engine uses its own bundled clang/lld toolchain, so your system-level LIBRARY_PATH and LD_LIBRARY_PATH settings won't automatically apply. Here are actionable steps to fix this:
1. Verify Carla's ThirdParty Assimp Setup
Unreal projects typically manage dependencies via a ThirdParty directory—first check if Carla includes assimp there:
- Navigate to your Carla project's
ThirdParty/assimpfolder. If it exists, ensure it has precompiled libraries matching Unreal's x64 clang toolchain (not your system's gcc-compiled version). - If the directory is missing or incomplete, run Carla's official setup script (
Setup.sh)—it’s designed to pull and configure all required third-party dependencies, including assimp, to match Unreal’s toolchain.
2. Explicitly Add Assimp Paths to Carla's Build Configuration
UnrealBuildTool relies on project-specific Build.cs files for dependency paths. Modify Carla's relevant Build.cs (usually in Source/Carla/Carla.Build.cs):
- Add the path to your assimp library directory with this code snippet:
string AssimpLibPath = "/path/to/your/assimp/lib/folder"; PublicLibraryPaths.Add(AssimpLibPath); PublicAdditionalLibraries.Add(Path.Combine(AssimpLibPath, "libassimp.so")); - Make sure the assimp library you’re pointing to is compiled with the same clang version as Unreal’s toolchain (v6.0.1 in your case) to avoid compatibility issues.
3. Pass Library Paths Directly to UnrealBuildTool
If modifying Build.cs isn’t feasible, you can pass the assimp library path as a command-line argument when compiling:
./Build.sh -project=/home/suho/Repository/Carla/Carla.uproject -librarypath="/path/to/assimp/lib"
This tells Unreal’s linker exactly where to look for libassimp.so.
4. Check Assimp Version Compatibility
Double-check that your local assimp version matches what Carla requires. Some versions introduce breaking changes—if Carla expects v4.x but you have v5.x installed, this will cause linking failures. Use Carla’s setup script to get the correct version instead of relying on Manjaro’s default package.
5. Temporary Hack: Copy Assimp to Unreal's Toolchain Libs
As a quick test to confirm it’s a path issue, copy libassimp.so and its associated files into Unreal’s toolchain library directory:
sudo cp /path/to/libassimp.so /home/suho/Repository/UnrealEngine/Engine/Extras/ThirdPartyNotUE/SDKs/HostLinux/Linux_x64/v12_clang-6.0.1-centos7/x86_64-unknown-linux-gnu/lib/
Note: This is a workaround, not a long-term solution—using Carla’s official setup is better for maintainability.
内容的提问来源于stack exchange,提问作者riemannulus

