Sunday, November 4, 2012

Matlab error of the type : /usr/bin/ld: matlab/sys/os/glnx86/ version `GLIBCXX_3.4.10' not found (required by /usr/bin/ld)

When I tried to compile mex files in Matlab (R2009a, 32-bit) on my Ubuntu 11.10 system, I got the following error:


/usr/bin/ld: /home/swagatika/softwares/matlab/sys/os/glnx86/ version `GLIBCXX_3.4.10' not found (required by /usr/bin/ld)
/usr/bin/ld: /home/swagatika/softwares/matlab/sys/os/glnx86/ version `GLIBCXX_3.4.11' not found (required by /usr/bin/ld)
/usr/bin/ld: /home/swagatika/softwares/matlab/sys/os/glnx86/ version `GLIBCXX_3.4.15' not found (required by /usr/bin/ld)
collect2: ld returned 1 exit status

    mex: link of ' "minFunc_2009/lbfgsC.mexglx"' failed.

Well, I found that I upgraded my system from v10.10 to 11.10. In the process, the libraries stored in Matlab were not updated with the system libraries.

So when such an error occurs,

1) Locate the library file in the system.
2)Remove or create a back up of the library in Matlab path.
3)Create a soft link in the matlab's appropriate folder for the one present in /usr/lib/

$ locate

$ln -s /usr/lib/i386-linux-gnu/

Now it compiles properly.

No comments:

Post a Comment