undefined reference to `secp256k1_ecdsa_sign_recoverable' #7261

issue doged opened this issue on December 28, 2015
  1. doged commented at 5:26 PM on December 28, 2015: none

    going through the make process, i run into this error: (i tried running a git clean)

    testb0x@testb0x-VirtualBox:~/bitcoin$ make Making all in src make[1]: Entering directory '/home/testb0x/bitcoin/src' make[2]: Entering directory '/home/testb0x/bitcoin/src' make[3]: Entering directory '/home/testb0x/bitcoin/src/secp256k1' make[3]: Leaving directory '/home/testb0x/bitcoin/src/secp256k1' CXXLD bitcoind libbitcoin_common.a(libbitcoin_common_a-key.o): In function CKey::SignCompact(uint256 const&, std::vector<unsigned char, std::allocator<unsigned char> >&) const': /home/testb0x/bitcoin/src/key.cpp:204: undefined reference tosecp256k1_ecdsa_sign_recoverable' /home/testb0x/bitcoin/src/key.cpp:206: undefined reference to secp256k1_ecdsa_recoverable_signature_serialize_compact' libbitcoin_common.a(libbitcoin_common_a-pubkey.o): In functionCPubKey::RecoverCompact(uint256 const&, std::vector<unsigned char, std::allocator<unsigned char> > const&)': /home/testb0x/bitcoin/src/pubkey.cpp:194: undefined reference to secp256k1_ecdsa_recoverable_signature_parse_compact' /home/testb0x/bitcoin/src/pubkey.cpp:197: undefined reference tosecp256k1_ecdsa_recover' collect2: error: ld returned 1 exit status Makefile:2759: recipe for target 'bitcoind' failed make[2]: *** [bitcoind] Error 1 make[2]: Leaving directory '/home/testb0x/bitcoin/src' Makefile:6870: recipe for target 'all-recursive' failed make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory '/home/testb0x/bitcoin/src' Makefile:636: recipe for target 'all-recursive' failed make: *** [all-recursive] Error 1 testb0x@testb0x-VirtualBox:~/bitcoin$

  2. sipa commented at 5:35 PM on December 28, 2015: member

    This is a problem resulting from linking against an older build result of libsecp256k1.

    Try make clean. If that doesn't work, try make clean inside src/secp256k1 directory. If that doesn't work, use git clean -dfx (which deletes all non-committed files; be careful if you have other work in the working directory).

  3. luke-jr commented at 5:36 PM on December 28, 2015: member

    Our build system is broken, so you will need to re-run autogen.sh and/or configure manually. :(

  4. doged commented at 7:21 PM on December 28, 2015: none

    @sipa yeah that just took me back to the beginning, make clean didnt work, make clean in secp256k1 didnt work, and git clean -dfx just brought me back in a circle lol

  5. doged commented at 7:23 PM on December 28, 2015: none

    after trying to do it manually in secp256k1 dir:

    testb0x@testb0x-VirtualBox:~/bitcoin/src/secp256k1$ make ./gen_context /bin/bash: ./gen_context: cannot execute binary file: Exec format error Makefile:1507: recipe for target 'src/ecmult_static_context.h' failed make: *** [src/ecmult_static_context.h] Error 126

  6. MarcoFalke commented at 7:23 PM on December 28, 2015: member

    @doged What is git log --oneline -1?

  7. doged commented at 7:29 PM on December 28, 2015: none

    @MarcoFalke be9a9a3 Merge pull request #7214

    i'm really really not sure how that helps.

  8. doged commented at 7:40 PM on December 28, 2015: none
  9. MarcoFalke commented at 8:27 PM on December 28, 2015: member

    I just wanted to make sure you are not running an odd commit. And your OS is latest Ubuntu?

  10. doged commented at 8:30 PM on December 28, 2015: none

    @MarcoFalke correct, ubuntu 15

  11. doged commented at 8:31 PM on December 28, 2015: none

    been getting alot of permission errors along the way, that might have something to do with it. for some reason i had to chmod+x build_detect_platform in leveldb, etc

  12. MarcoFalke commented at 8:34 PM on December 28, 2015: member

    I don't think chmod +x will solve any issues here. It may even create some. Not sure why people keep doing those...

    I can try to revive my Ubuntu box tomorrow and have a look. If you are bored in the meantime. You could try:

    git reset --hard be9a9a3
    git clean -dfx
    ./autogen.sh
    ./configure
    make
    

    and dump the output to some pastebin.

  13. doged commented at 8:31 AM on December 30, 2015: none

    @luke-jr i keep getting stuck here, which is odd because i can gcc gen_context in the dir, but even still it breaks on build

    configure: creating ./config.status /bin/bash ./config.status config.status: creating Makefile config.status: creating libsecp256k1.pc config.status: creating src/libsecp256k1-config.h config.status: src/libsecp256k1-config.h is unchanged config.status: executing depfiles commands config.status: executing libtool commands I. -Wall -Wextra -Wno-unused-function -c src/gen_context.c -o gen_context.o /bin/bash: I.: command not found Makefile:1497: recipe for target 'gen_context.o' failed make[3]: [gen_context.o] Error 127 (ignored) gen_context.o -o gen_context /bin/bash: gen_context.o: command not found Makefile:1500: recipe for target 'gen_context' failed make[3]: *** [gen_context] Error 127 make[3]: Leaving directory '/home/testb0x/bitcoin/src/secp256k1' Makefile:7378: recipe for target 'secp256k1/libsecp256k1.la' failed make[2]: *** [secp256k1/libsecp256k1.la] Error 2 make[2]: Leaving directory '/home/testb0x/bitcoin/src' Makefile:6882: recipe for target 'all-recursive' failed make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory '/home/testb0x/bitcoin/src' Makefile:636: recipe for target 'all-recursive' failed make: *** [all-recursive] Error 1 testb0x@testb0x-VirtualBox:~/bitcoin$

    why isnt it showing gcc before the -I. ? is there an easy command line fix for this?

  14. MarcoFalke commented at 2:48 PM on December 30, 2015: member

    @doged I can't reproduce on a fresh Ubuntu 15.10:

    $ sudo apt-get install git vim build-essential libtool autotools-dev automake pkg-config libssl-dev libevent-dev bsdmainutils
    $ sudo apt-get install libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-program-options-dev libboost-test-dev libboost-thread-dev
    $ sudo apt-get install libdb-dev libdb++-dev 
    $ sudo apt-get install libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools libprotobuf-dev protobuf-compiler
    $ git clone https://github.com/bitcoin/bitcoin.git
    $ cd bitcoin/
    $ git log -1 --oneline 
    be9a9a3 Merge pull request [#7214](/bitcoin-bitcoin/7214/)
    $ ./autogen.sh ;./configure --with-incompatible-bdb; make
    
  15. theuni commented at 6:23 PM on December 30, 2015: member

    @doged sounds like it's not finding your native gcc. Try exporting CC_FOR_BUILD=gcc

  16. doged referenced this in commit c61a02fa77 on Dec 30, 2015
  17. doged commented at 11:41 PM on December 30, 2015: none

    @theuni that fixed it. submitting pull request and closing. i hope this helps anyone else who runs into this issue on a fresh install.

  18. doged closed this on Dec 30, 2015

  19. doged referenced this in commit 77d8ff2bd8 on Dec 30, 2015
  20. DrahtBot locked this on Sep 8, 2021

github-metadata-mirror

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

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