Path: news.mathworks.com!not-for-mail
From: "Ashish Uthama" <first.last@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: running a c++ program using unix command
Date: Mon, 29 Dec 2008 13:43:36 -0500
Organization: TMW
Lines: 34
Message-ID: <op.umxsyyzga5ziv5@uthamaa.dhcp.mathworks.com>
References: <gj7286$dm1$1@fred.mathworks.com>
NNTP-Posting-Host: uthamaa.dhcp.mathworks.com
Mime-Version: 1.0
Content-Type: text/plain; format=flowed; delsp=yes; charset=iso-8859-15
Content-Transfer-Encoding: 7bit
X-Trace: fred.mathworks.com 1230576217 7799 172.31.57.126 (29 Dec 2008 18:43:37 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 29 Dec 2008 18:43:37 +0000 (UTC)
User-Agent: Opera Mail/9.60 (Win32)
Xref: news.mathworks.com comp.soft-sys.matlab:509120


On Sun, 28 Dec 2008 00:19:02 -0500, John finn <brainstuff@gmail.com> wrote:

> Hi,
>
> I am trying to run an executable (compiled c++ program) from within  
> matlab using either of unix, system or ! and i keep getting this error
>
> "matlabR2008a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.9' not  
> found"
>
> but running the same executable directly in the terminal in linux, works  
> perfectly fine. Is there something different about the way matlab makes  
> system calls to linux?
>
> specs of my setup are below:
> linux Mandriva 2008
> x86_64 Intel(R) Core(TM)2 Quad CPU    Q6600  @ 2.40GHz GNU/Linux
> matlab version 7.6.0.324 (R2008a)
>
> thanks
> john
>


Using 'ldd' on this file from within MATLAB (using '!') and outside MATLAB  
would give a hint.

MATLAB updates LD_LIBRARY_PATH which is causing the executable to  
dynamically link against MATLAB's libstdc++ (which it doest seem to like).  
You might try resetting LD_LIBRARY_PATH in the same line that you shell  
out.

Or, equivalently, create a wrapper shell script which sets up the paths as  
required and have MATLAB call it instead.