I am trying to make a software in "C++" for linux that reads the console output of the ldd console application. I would like to know if there is any '.so' library in the shared files of the system or another way of purely read the output of this command in console. Here is an example of the output of the command:
ldd ./echo
linux-vdso.so.1 => (0x00007fffdd8da000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fe95daf4000)
/lib64/ld-linux-x86-64.so.2 (0x000055a6179a6000)
This command print a list of the dependencies and the locations that has a binary file. I want to save this output in a variable or something else for being formatted later.