how to find the source and the destination directories to build a symbolic linked file to fix a common simulation error on Linux [Error 255] - /usr/bin/ld: cannot find -lstdc++

this is the very common error while you are doing a simulation on Linux:
/usr/bin/ld: cannot find -lstdc++ collect2: ld returned 1 exit status
I know that I should use this command to fix it:
ln -s (source directory of file file name) (desired destination directory)
But, still I have these problems:
1. I am confused with two different libstdc++ files:
libstdc++.so.6.0.17 libstdc++.so.6
and three different directories:
/usr/local/MATLAB/R2013a/sys/os/glnxa64/
/usr/local/MATLAB/R2013a/bin/glnxa64
/usr/lib/x86_64-linux-gnu/
I have used different commands, now I have these files:
file name: libstdc++.so.6 type: link to shared library directory: /usr/local/MATLAB/R2013a/bin/glnxa64
file name: libstdc++.so.6.0.17 type: shared library directory: /usr/local/MATLAB/R2013a/sys/os/glnxa64/
I don't have such a directory in my computer: /usr/lib/x86_64-linux-gnu/
2- I am not sure about the destination directory since I don't know how to use mex -v to build an output message, however, it seems that the destination should be /usr/local/MATLAB/R2014a/bin/glnxa64 based on the matlab message error:
/usr/local/MATLAB/R2014a/bin/mex -silent LDFLAGS="\$LDFLAGS " -output syncbuck_OL_sfun.mexa64 syncbuck_OL_sfun.o syncbuck_OL_sfun_registry.o c2_syncbuck_OL.o -L/usr/local/MATLAB/R2014a/bin/glnxa64 -lmwsf_runtime -L/usr/local/MATLAB/R2014a/bin/glnxa64 -lfixedpoint -L/usr/local/MATLAB/R2014a/bin/glnxa64 -lut -L/usr/local/MATLAB/R2014a/bin/glnxa64 -lemlrt -L/usr/local/MATLAB/R2014a/bin/glnxa64 -lmwmathutil -L/usr/local/MATLAB/R2014a/bin/glnxa64 -lmwblas -L/usr/local/MATLAB/R2014a/bin/glnxa64 -lmwsl_log_load_blocks -L/usr/local/MATLAB/R2014a/bin/glnxa64 -lippmwipt /usr/bin/ld: cannot find -lstdc++ collect2: ld returned 1 exit status
gmake: * [syncbuck_OL_sfun.mexa64] Error 255
3- I am not sure about the source directory. There is no such a path: /usr/lib/x86_64-linux-gnu in my computer. A similar one is: /usr/lib/x86_64-redhat-Linux5E. But, I couldn't find the mentioned files there. I guess the source directory is: /usr/local/MATLAB/R2013a/sys/os/glnxa64

Answers (0)

Categories

Asked:

on 12 Mar 2015

Edited:

on 12 Mar 2015

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!