samee@desk:/mnt/hdd8/axle/dev/dcmtk_reader/build$ ldd dicom_reader
linux-vdso.so.1 (0x00007ffe1cdd9000)
libofstd.so.17 => /mnt/hdd8/axle/dev/dcmtk_reader/build/dcmtk_install/usr/local/lib/libofstd.so.17 (0x00007fdd2065d000)
libdcmdata.so.17 => /mnt/hdd8/axle/dev/dcmtk_reader/build/dcmtk_install/usr/local/lib/libdcmdata.so.17 (0x00007fdd2046d000)
libdcmjpeg.so.17 => /mnt/hdd8/axle/dev/dcmtk_reader/build/dcmtk_install/usr/local/lib/libdcmjpeg.so.17 (0x00007fdd20425000)
libdcmjpls.so.17 => /mnt/hdd8/axle/dev/dcmtk_reader/build/dcmtk_install/usr/local/lib/libdcmjpls.so.17 (0x00007fdd20405000)
libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fdd20215000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fdd201f5000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fdd2001d000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fdd1fff5000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fdd1fead000)
liboflog.so.17 => not found
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fdd1fe8d000)
/lib64/ld-linux-x86-64.so.2 (0x00007fdd206b5000)
libijg8.so.17 => not found
libijg12.so.17 => not found
libijg16.so.17 => not found
libdcmimgle.so.17 => not found
liboflog.so.17 => not found
libdcmtkcharls.so.17 => not found
libdcmimgle.so.17 => not found
liboflog.so.17 => not found
So, it means it finds some libraries while fails to find the other. I can modify the LD_LIBRARY_PATH and get it working. But somehow that seems unnatural. Can anyone help me to point out what I need to fix?
Thanks.
This is the natural way to do it. Or copy the .so files to a path that is already searched, like /usr/local/lib, or, copy them to the directory where the dicom_reader binary resides. The latter works on windows, at least, but I think also on Linux.
I did few more google search and what I understand is this behavior is due to the difference between how direct and indirect dependencies are resolved (at least in Linux). Here is a link that discusses this: https://stackoverflow.com/questions/520 ... d#52020177
I added the following line to my CMakeLists.txt and that seems to resolve the issue. Although, I still need to understand it's implications in my package distribution workflow.