Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Conflict with mcc... libstdc++.so.6
Date: Mon, 2 Jun 2008 18:16:02 +0000 (UTC)
Organization: Erasmusmc
Lines: 50
Message-ID: <g21dd2$678$1@fred.mathworks.com>
References: <431d112e-2cfc-4e5e-8b68-e2dcac8b7008@w5g2000prd.googlegroups.com>  <b186357c-fe52-44e8-9f8d-f049a00a4058@l17g2000pri.googlegroups.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1212430562 6376 172.30.248.35 (2 Jun 2008 18:16:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 2 Jun 2008 18:16:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1095751
Xref: news.mathworks.com comp.soft-sys.matlab:471835



> Sebastian - by responding you are saving my life :) Thank you!
> The result of ldd hello is:
> 
>         linux-gate.so.1 =3D>  (0xffffe000)
>         libmwmclmcrrt.so =3D> /usr/local/matlab/bin/glnx86/
> libmwmclmcrrt.so (0x40001000)
>         libm.so.6 =3D> /lib/tls/libm.so.6 (0x42e08000)
>         libstdc++.so.5 =3D> /usr/lib/libstdc++.so.5
(0x439b9000)
>         libpthread.so.0 =3D> /lib/tls/libpthread.so.0
(0x42f20000)
>         libc.so.6 =3D> /lib/tls/libc.so.6 (0x42cea000)
>         libdl.so.2 =3D> /lib/libdl.so.2 (0x42e2d000)
>         libstdc++.so.6 =3D>
/usr/local/matlab/bin/glnx86/../../sys/os/
> glnx86/libstdc++.so.6 (0x40069000)
>         libgcc_s.so.1 =3D>
/usr/local/matlab/bin/glnx86/../../sys/os/
> glnx86/libgcc_s.so.1 (0x40146000)
>         /lib/ld-linux.so.2 =3D> /lib/ld-linux.so.2
(0x42cd1000)
> 
> So it looks like my platform uses libstdc++.so.5. Is there any
> solution where I can tell MATLAB to use .so.6?
> 
> I'm not sure I understand what you meant by compiling with
-L/opt/
> matlab/2007b/sys/os/glnxa64/-lstdc++. There is not -L flag
with mcc
> that I can see.

Funny, it is actually linked to .so.5 and .so.6. Seems
strange, but I am not an expert on this.

I also have no experience with mcc, only with mex files.

From
http://www.gravity.psu.edu/~s4/software/MATLAB-R2006a/Compiling_MATLAB_Release_2006a.html
it seems that you have to edit bin/mbuildopts.sh (or better:
~/.matlab/R2007b/mbuildopts.sh which is the one you can and
should edit) and change:
CLIBS="$RPATH $MLIBS -lm $TMW_ROOT/sys/os/$Arch/libstdc++.so.6""

in the section belonging to your architecture (seems glnx86).

Does it work?

Greetz,
Sebastiaan