While we are migrating our code from commonly we are getting such kind of library error.
Today while I am migrating code at redhat7, we are facing this issue let me explain why this error occur and how to resolve this.
Step 1 find path of libstdc++.so.6 file in system and check the library
> ldd /usr/lib64/libstdc++.so.6
Find this library in (/usr/local/lib64, /usr/lib64) directory. Hope fully it will be available in any of these path.
To fix this issue we should add below line in our Makefile or command line parameters:-
Another option is we can use g++ instead of gcc. This will automatically link stdc++ without specify it explicitly.
Library for gcc and g++ are different, so whenever use invoke the g++ library in gcc above error occur.