Search code examples
matlabmex

(version `GLIBCXX_3.4.18') Not found for compiling mex files in matlab


This is due to the outdated version of libgfortran inside Matlab. We need to modify it to point it to a different one inside the directory.


Solution

  • cd /usr/local/MATLAB/<matlabversion>/sys/os/glnxa64
    ls -l
    

    create new symlinks:

    sudo rm libgfortran.so.3
    
    sudo ln -s /usr/lib/x86_64-linux-gnu/libgfortran.so.3.0.0 libgfortran.so.3
    
    sudo rm libstdc++.so.6
    
    sudo ln -s /usr/lib/gcc/x86_64-linux-gnu/4.4/libstdc++.so libstdc++.so.6