Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a problem with the libstdc++.so.6 library when I execute a program in MATLAB. The code works fine on my laptop and my desktop, which is why I'm sure the problem is a library or linking compatibility issue:

/home/arturo/Virality/viral_cluster_ml/Viral_features/code/segment_pedro/segment: error while loading shared libraries: libstdc++.so.6: wrong ELF class: ELFCLASS64

I've google some answers on how to fix the library, and some say that I should remove the library to later re-install the correct version: http://stackoverflow.com/questions/3967661/error-while-loading-shared-libraries-libstdc-so-6-wrong-elf-class-elfclass6

The problem is that I can't afford the luxury to delete a library, because I am ssh'ing to a cluster at the lab I'm working in. I really wouldn't want to mess up any programs that are running at the cluster, so isn't there another way of fixing this problem? I'm hoping a solution similar to:

sudo apt-get install libstd++6

that doesn't require me to delete or modify any files, but rather to install them.

Or maybe the error is that I'm not linking the library correctly?

The file does exist, as when I use

locate  libstd++.so.6

the computer finds it at these directories:

/usr/lib64/libstdc++.so.6
/usr/lib64/libstdc++.so.6.0.13
/usr/local/MATLAB/R2012b/sys/os/glnxa64/libstdc++.so.6
/usr/local/MATLAB/R2012b/sys/os/glnxa64/libstdc++.so.6.0.13
/usr/local/MATLAB/R2012b/toolbox/sldv/sldv/polyspace-dvo/lib/x86-linux/libstdc++.so.6
/usr/local/MATLAB/R2012b/toolbox/sldv/sldv/polyspace-dvo/lib/x86-linux/libstdc++.so.6.0.13
/usr/local/MATLAB/R2013a/sys/os/glnxa64/libstdc++.so.6
/usr/local/MATLAB/R2013a/sys/os/glnxa64/libstdc++.so.6.0.13
/usr/local/MATLAB/R2013a_DCS/sys/os/glnxa64/libstdc++.so.6
/usr/local/MATLAB/R2013a_DCS/sys/os/glnxa64/libstdc++.so.6.0.13
/usr/local/Matlab_R2012a/bin/glnxa64/libstdc++.so.6
/usr/local/Matlab_R2012a/bin/glnxa64/libstdc++.so.6.0.13
/usr/local/Matlab_R2012a/sys/os/glnxa64/libstdc++.so.6
/usr/local/Matlab_R2012a/sys/os/glnxa64/libstdc++.so.6.0.13
/usr/local/Matlab_R2012a/toolbox/sldv/sldv/polyspace-dvo/lib/x86-linux/libstdc++.so.6
/usr/share/gdb/auto-load/usr/lib/libstdc++.so.6.0.13-gdb.py
/usr/share/gdb/auto-load/usr/lib/libstdc++.so.6.0.13-gdb.pyc
/usr/share/gdb/auto-load/usr/lib/libstdc++.so.6.0.13-gdb.pyo
/usr/share/gdb/auto-load/usr/lib64/libstdc++.so.6.0.13-gdb.py
/usr/share/gdb/auto-load/usr/lib64/libstdc++.so.6.0.13-gdb.pyc
/usr/share/gdb/auto-load/usr/lib64/libstdc++.so.6.0.13-gdb.pyo

I've also tried setting the path to the the file before running MATLAB, without anyluck:

LD_LIBRARY_PATH=/usr/lib64:/home/arturo/Virality/viral_cluster_ml/Viral_features/code/scene_sun ./matlab

Similar link and problem: http://www.linuxquestions.org/questions/linux-newbie-8/apt-get-messed-up-812346/

*The Cluster's distribution is Scientific Linux.

share|improve this question

closed as off-topic by Thomas W., Eric Carvalho, Seth, RolandiXor Dec 13 '13 at 4:50

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This is not about Ubuntu. Questions about other Linux distributions can be asked on Unix & Linux, those about Windows on Super User, those about Apple products on Ask Different and generic programming questions on Stack Overflow." – Thomas W., Eric Carvalho, Seth, RolandiXor
If this question can be reworded to fit the rules in the help center, please edit the question.

    
"Scientific Linux" is not an official derivative of Ubuntu, and is offtopic here. This is why it was closed. (this post was out of courtesy to others.) –  Thomas W. Dec 14 '13 at 19:58
add comment

1 Answer 1

file /home/arturo/Virality/viral_cluster_ml/Viral_features/code/segment_pedro/segment

file /usr/lib/libstdc++.so.6.0.13

maybe your segment is 32bit version but your libstdc++.so.6.0.13 is 64bit.

get a 32bit libstdc++.so.6.0.13 and copy it to /usr/lib/:

wget ftp://rpmfind.net/linux/Mandriva/official/2010.1/i586/media/main/release/libstdc++6-4.4.3-2mnb2.i586.rpm

rpm2cpio libstdc++6-4.4.3-2mnb2.i586.rpm |cpio -idmv # unpack

sudo cp usr/lib/libstdc++.so.6.0.13 /usr/lib/

ln -s /usr/lib/libstdc++.so.6.0.13 /usr/lib/libstdc++.so.6

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.