DSO missing from command line and error adding symbols Fix error /usr/lib64/libstdc++.so.6
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 occurs and how to resolve this.
Step 1 find the path of libstdc++.so.6 files in the system and check the library
> ldd /usr/lib64/libstdc++.so.6 linux-vdso.so.1 =>(Address)
Find this library in (/usr/local/lib64, /usr/lib64) directory. Hopefully, it will be available in any of these paths.
To fix this issue we should add the 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 specifying it explicitly.
gcc and g++ are different, so whenever use invokes the g++ library in gcc above error occur.