Wants to add eigen library to ue4 plugin

Hello, I am trying to add eigen library to my ue4 plugins. I followed this tutorial and created a plugin.

And in plugin create option, I selected this.

But when I opened it in rider for unreal engine. rider does not recognize the include path.
image
and it does not recoginze this function


it will cause error saying the function is void when i click compile in rider IDE.

my plugin.build.cs file set up like this

my file hierarchy like this.

MyPlugin.uplugin file set up.

testplugins.uproject file set up.
image

any advice would be greatly appreciated.

I figured out. So I just need to add the search path for thirdpartylibrary folder

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");

To suppress the warning in your local code:

#pragma warning(push)
#pragma warning(disable : 4702) // Disable unreachable code warning

#include "Eigen/Dense"

#pragma warning(pop)