error while loading shared libraries: libsecp256k1.so.0: cannot open shared object file: No such file or directory #542

issue JBaczuk opened this issue on July 27, 2018
  1. JBaczuk commented at 8:56 PM on July 27, 2018: none

    I've compiled and run $ sudo make install and the files were installed under /usr/local/lib in Ubuntu 16.04:

    drwxr-xr-x  5 root root  4.0K Jul 27 13:22 .
    drwxr-xr-x 10 root root  4.0K Aug  1  2017 ..
    -rw-r--r--  1 root root  543K Jul 27 13:22 libsecp256k1.a
    -rwxr-xr-x  1 root root   968 Jul 27 13:22 libsecp256k1.la
    lrwxrwxrwx  1 root root    21 Jul 27 13:22 libsecp256k1.so -> libsecp256k1.so.0.0.0
    lrwxrwxrwx  1 root root    21 Jul 27 13:22 libsecp256k1.so.0 -> libsecp256k1.so.0.0.0
    -rwxr-xr-x  1 root root  414K Jul 27 13:22 libsecp256k1.so.0.0.0
    

    Then, I included the library in my project:

    g++ -std=c++11 -Wall -g -I./src -o bin/btc_wallet_tests tests/runner.cpp build/keypair_tests.o build/key.o -L./lib -L/usr/local/lib -lboost_unit_test_framework -lsecp256k1

    But, when I run the final binary, it says

    error while loading shared libraries: libsecp256k1.so.0: cannot open shared object file: No such file or directory

    I finally got it working, but I had to do:

    $ LD_LIBRARY_PATH=/usr/local/lib $ export LD_LIBRARY_PATH

    Is this a non-standard installation location? Just wondering if this is something on my end or in the autotools scripts that might need to be adjusted?

  2. sipa commented at 9:12 PM on July 27, 2018: contributor

    This is the standard installation directory for custom-compiled software, in order to avoid clashing with libraries installed by the package manager.

    If you want to install things in a default location for your distribution, you need to configure it to do so (for example ./configure --prefix=/usr).

  3. sipa closed this on Jul 27, 2018

  4. sipa cross-referenced this on Nov 11, 2019 from issue Signed-digit multi-comb for ecmult_gen (by peterdettman) by sipa

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/secp256k1. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-20 16:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me