Path: news.mathworks.com!not-for-mail
From: "Matthew" <mp_nospam@yahoo.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: running a c++ program using unix command
Date: Wed, 14 Jan 2009 21:38:02 +0000 (UTC)
Organization: Columbia
Lines: 61
Message-ID: <gkllvq$96u$1@fred.mathworks.com>
References: <gj7286$dm1$1@fred.mathworks.com>
Reply-To: "Matthew" <mp_nospam@yahoo.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 1231969082 9438 172.30.248.37 (14 Jan 2009 21:38:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 14 Jan 2009 21:38:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 839019
Xref: news.mathworks.com comp.soft-sys.matlab:511628


Hello,

I have the same problem.  I've tried the suggestions described here and on another thread that discusses it, but none of them have worked.  NB 'mexatexit.cpp' compiles and runs for me, but I need to use the STL classes.

My file, 'matreader.mexglx', compiles fine except for this warning; 

Warning: You are using gcc version "4.2.4".  The earliest gcc version supported
with mex is "4.0.0".  The latest version tested for use with mex is "4.2.0".

When I try to run it I get this:

>> matreader("test")
??? Invalid MEX-file '/home/matt/Projects/SaveData/matreader.mexglx':
/home/matt/bin/glnx86/../../sys/os/glnx86/libstdc++.so.6: version
`GLIBCXX_3.4.9' not found (required by
/home/matt/Projects/SaveData/matreader.mexglx).

So I went into <matlabroot>/sys/glnx86, where I found libstdc++.so.6, which in my case is a soft link to libstdc++.so.6.0.8 in the same directory.

Then I went and found my version of libstdc++.so.6 in /usr/lib, as others have done.  There, it's a soft link to libstdc++.so.6.0.9 --a different version.  But when I changed the soft link in sys/glnx86 to point to this version, I got this error message when I tried to restart Matlab:

/home/matt/bin/glnx86/MATLAB: /home/matt/bin/glnx86/../../sys/os/glnx86/libgcc_s.so.1: version `GCC_4.2.0' not found (required by /home/matt/bin/glnx86/../../sys/os/glnx86/libstdc++.so.6)

(I am also getting a 'locking assertion' error but that seems Java-related.)  Finally when I run ldd from the shell, I get the following:

	linux-gate.so.1 =>  (0xb7fc6000)
	libmx.so => not found
	libmex.so => not found
	libmat.so => not found
	libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0xb7f88000)
	libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb7e95000)
	libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb7e8a000)
	libpthread.so.0 => /lib/tls/i686/cmov/libpthread.so.0 (0xb7e72000)
	libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7d22000)
	/lib/ld-linux.so.2 (0xb7fc7000)

This has me pretty confused--so apparently it is finding libstdc++.so.6 in /usr/lib?!  I don't understand that.  NB I also altered LDPATH_PREFIX in /bin/scripts/matlab7rc.sh to equal '/usr/bin', to no effect.

Please help, thank you!

Matlab 2007b, Dell Inspiron 640m, Ubuntu 8.04

Matt

"John finn" <brainstuff@gmail.com> wrote in message <gj7286$dm1$1@fred.mathworks.com>...
> 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