I am getting the following error when I trying to a run mex file in MATLAB:
??? Invalid MEX-file \'findimps3.mexa64\': /MATLAB/bin/glnxa64/../../sys/os/glnxa
I (think I) fixed this problem by running matlab with LD_PRELOAD, like this
LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libfreetype.so:/usr/lib/x86_64-linux-gnu/libgfortran.so.3 matlab
Notice freetype was another library I was having a similar problem with.