How to get rid of libstd-xxx.so dependency

I've created a workspace project with a library and a binary.
I can run the binary with "cargo run" successfully. But when I try to run it directly it complains that libstd-afd4b9aba051f3ad.so is missing. I cannot find this library neither in the project directory nor in the rust installation.
ldd output:

        linux-vdso.so.1 (0x00007ffe873ab000)
        libzarlib.so => ./libzarlib.so (0x00007f43e3659000)
        libstd-afd4b9aba051f3ad.so => not found
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f43e35f8000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f43e3406000)
        libstd-afd4b9aba051f3ad.so => not found
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f43e33e3000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f43e3c67000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f43e3292000)

How can I get rid of this dependency?

How did you try to run it directly?

From the command line in directory target/debug.

Normally libstd-*.so is only used when either you passed -Cprefer-dynamic to rustc or you have a rust dependency that is only available as dynamic library and not as static library. You can use rustup run stable path/to/executable to run the executable with the right LD_LIBRARY_PATH set to find libstd-*.so.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.