I'm working on an UE4 plugin and want to use the Eigen library. It appears that UE4 has already integrated the library, which you can see in Engine>Source>ThirdParty>Eigen.
I looked at other plugins, such as AlembicImporter, for guidance. To use Eigen, I see that they add "Eigen"
in the build.cs file and write #include <Eigen/...>
in the source files that use Eigen, where ...
could be either Dense, SVD, Sparse, etc.
I tried this, but when I build my project, I get the error
fatal error: 'Eigen/Dense' file not found
(Similarly, I get an error for any Eigen/...
I try to use)
Looks like prebuilt UE4 doesn't include the "compiled" Eigen headers ("Dense", "Sparse", etc.), though it does include the Eigen "src" folder.
If you compile your Engine from source, you should have a complete Eigen install in the ThirdParty folder. You can then use that just like various Engine plugins do. But compiling Unreal from source is a bit of a pain and takes a lot of hard drive space. This would also prevent you from distributing your plugin in source form, as normal users wouldn't have Eigen available.
It's probably easiest to include a local copy of Eigen with your plugin - it's just headers, so you can include it with just a private include path in the build.cs.