Skip to content

libbitcoinconsensus.a is unusable #28779

@hebasto

Description

@hebasto

On Ubuntu 22.04, in the master branch @ 0857f29:

$ ./autogen.sh
$ ./configure --without-daemon --without-gui --without-utils --disable-tests --disable-bench --disable-fuzz-binary --disable-shared --prefix=/
$ make
$ make DESTDIR=~/CONSENSUS install
$ g++ testconsensus.cpp -o testconsensus -I ~/CONSENSUS/include -L ~/CONSENSUS/lib -l:libbitcoinconsensus.a
/usr/bin/ld: /home/hebasto/CONSENSUS/lib/libbitcoinconsensus.a(libbitcoinconsensus_la-pubkey.o): in function `ecdsa_signature_parse_der_lax(secp256k1_ecdsa_signature*, unsigned char const*, unsigned long)':
./src/pubkey.cpp:50: undefined reference to `secp256k1_context_static'
/usr/bin/ld: ./src/pubkey.cpp:50: undefined reference to `secp256k1_ecdsa_signature_parse_compact'
/usr/bin/ld: ./src/pubkey.cpp:179: undefined reference to `secp256k1_ecdsa_signature_parse_compact'
/usr/bin/ld: ./src/pubkey.cpp:173: undefined reference to `secp256k1_ecdsa_signature_parse_compact'
...
$ cat testconsensus.cpp 
#include <iostream>

#include <bitcoinconsensus.h>

int main()
{
    std::cout << "bitcoinconsensus version: " << bitcoinconsensus_version() << std::endl;
    return 0;
}

It is worth mentioning that the static libbitcoinconsensus.a library is not shipped as a part of a release package.

However, in the light of upcoming migration to CMake, 100% feature compatibility is expected, and a few options might be considered:

  1. Fix the current build system.
  2. Disable building static libraries in the current build system.
  3. Something else.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions