I found the solution. We don’t need to download the Eigen library for inclusion in the plugin; we can simply use Unreal Engine’s built-in version for UE5.4. When you use the Eigen library from a download, it works in the editor, but after packaging the project and opening it, the project crashes when calling functions related to Eigen. I believe this is caused by Unreal Engine’s memory allocation being different from that of the Eigen library.
In YourPlugin.Build.cs:
// Use Unreal Engine built-in Eigen as a third-party dependency
AddEngineThirdPartyPrivateStaticDependencies(Target, "Eigen");
If you encounter an error during the project packaging related to unreachable code, you can suppress the error and continue compiling.
Also in YourPlugin.Build.cs:
// Suppress compiler warning C4702 for unreachable code
PublicDefinitions.Add("EIGEN_IGNORE_UNREACHABLE_CODE_WARNING=1");