3

I am trying to run gnuplot directly from Matlab (running in Debian Linux), but I get the following error:

>> unix('gnuplot defaults_loan10.p');
gnuplot: /usr/local/MATLAB/R2011b/sys/os/glnx86/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /usr/lib/i386-linux-gnu/libwx_baseu-2.8.so.0)

Running gnuplot from the console works perfectly well. How can I fix it?

Grzenio
  • 35,875
  • 47
  • 158
  • 240

1 Answers1

3

That's because Matlab uses its own LD_LIBRARY_PATH

try to use the command setenv to set back this environment variable as you like.

For instance:

setenv('LD_LIBRARY_PATH','/usr/lib')

You can check the content of LD_LIBRARY_PATH befor and after by executing:

!echo $LD_LIBRARY_PATH
Oli
  • 15,935
  • 7
  • 50
  • 66
  • So what should be the correct Matlab code to run? Sorry, I am not really experienced with Matlab... – Grzenio Mar 21 '12 at 12:12
  • Do you have experience with linux? – Oli Mar 21 '12 at 12:15
  • Just checked that this one also works: `unix('LD_LIBRARY_PATH=/lib;gnuplot defaults_loan10.p');` – Grzenio Mar 21 '12 at 12:16
  • If it works that is indeed a LD_LIBRARY_PATH issue, in your case, `setenv('LD_LIBRARY_PATH','/lib');unix('gnuplot defaults_loan10.p');` should also work. – Oli Mar 21 '12 at 12:19