0

I Installed protobuffer in my solaris 11, Now to generate the addressbook.pb.h and addressbook.pb.cc file i gave given below command

protoc -I=$SRC_DIR --cpp_out=$DST_DIR $SRC_DIR/addressbook.proto

but instead of getting desired file i got given below error:

ld.so.1: protoc: fatal: libstdc++.so.6: version 'GLIBCXX_3.4.20' not found (required by file /export/home/shivamv/Downloads/PROTO_BUFF/protobuf-master/src/.libs/libprotobuf.so.15)
 ld.so.1: protoc: fatal: libstdc++.so.6: open failed: No such file or directory

I checked libstdc++.so.6 by given below command:

strings /usr/lib/libstdc++.so.6 | grep GLIBCXX

so i got this output:

GLIBCXX_FORCE_NEW
GLIBCXX_DEBUG_MESSAGE_LENGT

Please help me to resolve this issue :)

Shivam
  • 211
  • 1
  • 13

2 Answers2

1

Actually, it's pretty straight forward.

fatal: libstdc++.so.6: version 'GLIBCXX_3.4.20' not found

All that message is telling you is that you need GLIBCXX, specifically version 3.4.20 (it might support a later version instead), but that it isn't installed.

libstdc++ is just the standard C++ library, and it does not include the actual GLIBCXX library. It only knows you need that library - or specifically that libprotobuf does - and it isn't finding it.


Now, I work on Linux, and personally don't know how to install anything on Solaris specifically. It appears that GLIBCXX is part of GLIBC, which apparently needs to be built from source. However, like I said, I don't know Solaris specifically, so I could be wrong on that part.

CodeMouse92
  • 6,840
  • 14
  • 73
  • 130
  • CodeMouse92 : Not glibc, but the (gnu)lib(std)cxx → libstdc++. `GLIBCXX_3.4.20` is an object in the gcc libstdc++, from version 4.9.0 ( libstdc++.so.6.0.20 ) Please try `$ objdump -x /usr/lib64/libstdc++.so.6 | grep GLIBCXX_3.4.20` – Knud Larsen Feb 02 '18 at 15:57
1

It may not be the best solution, however you can tell the runtime linker to ignore the shared library versions.

export LD_NOVERSION=1

but it is working for me.

Shivam
  • 211
  • 1
  • 13