10

I'm trying to run some pre-compiled code but I'm getting the following error:

./bin/stipdet: /cm/shared/apps/gcc/4.3.4/lib64/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by ./bin/stipdet)

I googled the error and saw that some people solved similar problems by deleting the libstdc++.so.6 and adding a new dynamic link pointing to usr/local/lib. But I don't have root access on the system I'm trying to run this on, so I can't add/delete files in that directory.

Does anyone know another way to solve this problem?

UPDATE:
I tried adding the directory of another version of libstdc++.so.6 to the LD_PRELOAD, but it didn't work for me, it still uses the file from the wrong directory.

The same happens when I prepend the correct directory to the LD_LIBRARY_PATH. Finally, I also tried to remove everything else from the LD_LIBRARY_PATH and then add the correct directory (just to try). This seemed to fix the original error! But now I'm getting the same error at a different location:

./bin/stipdet: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by /var/scratch/user/local/lib/libopencv_features2d.so.2.2)

Apparently opencv uses a different glibcxx version, so switching to another libstdc breaks opencv. Is there any way around this problem?

fedorqui
  • 275,237
  • 103
  • 548
  • 598
Bart
  • 1,077
  • 1
  • 12
  • 22

4 Answers4

4

If you've got the correct version of libstdc++.so.6 installed elsewhere (e.g. in your home directory), you can either set LD_LIBRARY_PATH or use LD_PRELOAD, see What is the LD_PRELOAD trick?

Community
  • 1
  • 1
Frank Schmitt
  • 30,195
  • 12
  • 73
  • 107
  • Thanks. I updated my question with the results of your advice. It now breaks somewhere else :( – Bart Jun 08 '11 at 21:23
0

The libstdc++ FAQ answers your original question: http://gcc.gnu.org/onlinedocs/libstdc++/faq.html#faq.how_to_set_paths

For the update, that shouldn't happen. The newer libstdc++.so thaqt should be found in your LD_LIBRARY_PATH provides all the symbols of the older one. Maybe /var/scratch/user/local/lib/libopencv_features2d.so.2.2 was linked to an absolute path, not to the SONAME libstdc++.so.6, you could check that by running:

ldd /var/scratch/user/local/lib/libopencv_features2d.so.2.2
Jonathan Wakely
  • 166,810
  • 27
  • 341
  • 521
0

I copied the file A(/usr/lib64/libstdc++.so.6) to the dictionary B(/opt/MATLAB/MATLAB_Compiler_Runtime/v711/sys/os/glnxa64) and it worked.

0

It would help if you tell what OS you are running. If it is Solaris, you might want to try setting LD_NOVERSION to tell the runtime linker to ignore the shared library versions.

export LD_NOVERSION=1

jlliagre
  • 29,783
  • 6
  • 61
  • 72
  • when I type uname -a it says Linux x86_64 x86_64 x86_64 GNU/Linux. And when I log in to the system it says "Based on CentOS 5" – Bart Jun 09 '11 at 11:18
  • 1
    I'm afraid there is no LD_NOVERSION equivalent with Linux. – jlliagre Jun 09 '11 at 21:12