matlab and shared C++ library with no root permission

2 views (last 30 days)
Hi everyone,
I am installing a package that requires me to run mex on some cpp files. I do set LD_LIBRARY_PATH to /usr/lib and the cpp program compiles ok using mex and when i run system('ldd mexProgram.mexglx') in matlab it shows me libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb7657000)
But when i attempt to run the program (calling it from a matlab script), it throws the following error: ??? Invalid MEX-file 'mexProgram.mexglx': /home/mathworks_2011a/bin/glnx86/../../sys/os/glnx86/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by mexProgram.mexglx)
Most of the people suggest creating a new link in $MATLABROOT/sys/os/glnx86 that point to the libstdc++.so.6 in /usr/lib but I do not have root permissions to change the contents in $MATLABROOT/sys/os/glnx86.
Could any one point me in a direction to get this working?
Thank you very much!

Answers (1)

McBoss Mahu
McBoss Mahu on 27 Apr 2012
basically run the following (assuming you have csh or use export for bash)
setenv LD_PRELOAD '/usr/lib/libstdc++.so.6.0.16' matlab

Categories

Find more on C Shared Library Integration in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!