I’m trying to create a plugin that utilizes Eigen library for matrix calculations.
The plugin compiles and I can package it successfully, but Epic team encountered the following error:
D:\RocketSync\5.4.0-33043543+++UE5+Release-5.4\Working\Engine\Source\Runtime\Experimental\Chaos\Public\Chaos\ParticleHandle.h(1729): error C4459: declaration of ‘Dynamic’ hides global declaration
D:\RocketSync\5.4.0-33043543+++UE5+Release-5.4\Working\Engine\Source\ThirdParty\Eigen\Eigen\src\Core\util\Constants.h(22): note: see declaration of ‘Eigen::Dynamic’
I’m including Eigen as include “ThirdParty/Eigen/Eigen/Core”, and the following lines of code are only ones that mention Eigen::Dynamic :
Eigen::Matrix<float, Eigen::Dynamic, Eigen::Dynamic> WeightMatrix;
Eigen::Matrix<float, Eigen::Dynamic, 1>> BiasVector;
I was looking for an answer in UE source code and saw that they include Eigen as:
PRAGMA_DEFAULT_VISIBILITY_START
THIRD_PARTY_INCLUDES_START
include <Eigen/Core>
THIRD_PARTY_INCLUDES_END
PRAGMA_DEFAULT_VISIBILITY_END
Also in .Build.cs file they have the following:
AddEngineThirdPartyPrivateStaticDependencies(Target,
“Eigen”,
);
This is my first time creating a plugin and I’m not quite sure what might the cause be.
I can go by trial and error, but considering that each time I submit changes I need to wait a week or two, I decided to ask here first if someone had a similar issue.
All help is appreciated. Thanks.