You are not logged in.

#1 2009-12-15 08:25:05

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,355

[solved] C++ shared library requests 3.4.11 when I only have 4.2?

Hi all,

I use Eclipse CDT and have a project consisting of an executable which calls on .so dynamic libraries for functionality. My executable can also compile into a Matlab mex-file, so that I can do mathematical analysis on the results.

This has been working pretty well for about a year, but recently Matlab refused to call any of my dynamic libraries, with the following error message:-

/home/LinuxProg/Matlab/bin/glnxa64/../../sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by ./libs/inAD.so)

The exact same code (except for the matlab wrapper) works externally to matlab. Confusingly, if I compile the executable and dynamic libraries with -O0 instead of my normal -O2/3, it works fine.

My idea is that its perhaps due to some mismatch between gcc versions, as that's what was updated recently I think, but it has run properly a few times before this started becoming an issue, after the latest gcc update to 4.4.2.


Anyway, that's the situation, does anyone have any idea what's may create such an issue? Suggestions on things I can try are appreciated as well.


EDIT: Sigh, spend a week cracking your head on an issue and you find the answer 10 minutes AFTER posting a question on the boards... I worked around the issue by moving matlab's built-in gcc out of the way and symlinking the system gcc.

Last edited by ngoonee (2009-12-15 09:07:46)


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#2 2010-04-01 12:58:34

michaelfsp
Member
Registered: 2009-02-08
Posts: 10

Re: [solved] C++ shared library requests 3.4.11 when I only have 4.2?

Hi ngoonee,

I am having the same problem as you, trying to use a new toolbox with MATLABR2010a. Could you detail the way you fixed it so I could try it out?

Thanks in advance.

Cheers

Offline

#3 2010-04-01 23:34:21

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,355

Re: [solved] C++ shared library requests 3.4.11 when I only have 4.2?

Find $MATLABROOT/sys/os/{glnx86,glnx164}, replace libstdc++.so.* and libstdc++.so.*.*.* with symlinks to /usr/lib/libstdc++ equivalents. Move the existing ones out of the way instead of deleting them.


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#4 2010-04-06 10:28:47

michaelfsp
Member
Registered: 2009-02-08
Posts: 10

Re: [solved] C++ shared library requests 3.4.11 when I only have 4.2?

Oh wow! Thank you! It works like a charm! big_smile

Offline

#5 2010-11-02 10:21:35

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,355

Re: [solved] C++ shared library requests 3.4.11 when I only have 4.2?

Just to add, I just installed Matlab 2010b, and had to troubleshoot this again (gcc is at 4.5 here).

Going to $MATLABROOT/sys/os/glnxa64 and moving libstdc++* and libgcc_s* out of the way (no need to link, it'll automatically look for system versions) is just part of the puzzle.

Additionally you have to go to $MATLABROOT/bin/glnxa64 and move libdc1394.so.22* out of the way. Without that, I was getting an error about:-

??? Invalid MEX-file
'xxx.mexa64':
libraw1394.so.8: cannot open shared
object file: No such file or directory.

Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

Board footer

Powered by FluxBB