I’m currently playing around with procedural terrain generation. For this purpose I have to to some matrix calculations and as far as I’ve seen, the UE4 Math library only supports 4x4 matrices. So I’d like to use an external math library, e.g. armadillo (http://arma.sourceforge.net/)
Has anyone tried to use an external math library in UE4?
I was able to load the armadillo library, but when I include it in a UCLASS, I get compilation errors.
I think, the problem is, that the macro “check” is defined in armadillo and UE4.
Any idea on how to resolve this problem?
I get 148 errors in total, most of them are one of these three:
d:\programme\programmieren\unreal projects\extern libraries\armadillo\armadillo-6.100.0\include\armadillo_bits/glue_mixed_meat.hpp(484): error C4003: not enough actual parameters for macro ‘check’
d:\programme\programmieren\unreal projects\extern libraries\armadillo\armadillo-6.100.0\include\armadillo_bits/glue_mixed_meat.hpp(484): error C4003: not enough actual parameters for macro ‘CA_ASSUME’
d:\programme\programmieren\unreal projects\extern libraries\armadillo\armadillo-6.100.0\include\armadillo_bits/traits.hpp(87) : see declaration of ‘T’
If you want to see all errors I get, just look at the text file I added
MSVC, GCC and Clang all support #pragma push_macro/pop_macro, which means you can just push the check macro before including Armadillo, and pop it afterwards:
#ifdef check
# pragma push_macro("check")
# undef check
# include <armadillo>
# pragma pop_macro("check")
#else
# include <armadillo>
#endif