Path: news.mathworks.com!not-for-mail
From: "John finn" <brainstuff@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: running a c++ program using unix command
Date: Mon, 29 Dec 2008 21:47:01 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 43
Message-ID: <gjbggl$2g0$1@fred.mathworks.com>
References: <gj7286$dm1$1@fred.mathworks.com> <op.umxsyyzga5ziv5@uthamaa.dhcp.mathworks.com>
Reply-To: "John finn" <brainstuff@gmail.com>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1230587221 2560 172.30.248.37 (29 Dec 2008 21:47:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 29 Dec 2008 21:47:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1652117
Xref: news.mathworks.com comp.soft-sys.matlab:509147


Hi Ashish, 

that was exactly the problem its fixed by running the program from a shell script adding the following line before calling the executable. 

export LD_LIBRARY_PATH=/usr/lib64;

thanks for that

"Ashish Uthama" <first.last@mathworks.com> wrote in message <op.umxsyyzga5ziv5@uthamaa.dhcp.mathworks.com>...
> 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.