It depends on how the SampleApp executable was created. You will see this error if it was statically linked. ltrace only works for dynamically related applications.
You can run ldd SampleApp to display dependencies of shared objects. It is dynamically linked and has a dependency on libc, ldd output will contain the following line:
libc.so.6 => /usr/lib/libc.so.6 (0x00007fb24ac53000)
In this case, you can use the ltrace --library=libc.so.6 option, and it should work. However --library=libc.so will not match (you will not get an error, but the library call will not be consistent).
With a static ldd SampleApp instead display this result:
not a dynamic executable
My guess is that this is due to static linking, which might be wrong. It is important, however, that if ltrace shows this error, you need to run the diagnosis in the executable file (binary) and how it was created (linker options), and not in the shared library.
Question How does ltrace (library trace tool) work? has some good links to learn more about the internal elements of ltrace.
source share