BlockstreamResearch / secp256k1-zkp

A fork of libsecp256k1 with support for advanced and experimental features such as Confidential Assets and MuSig2
MIT License
365 stars 207 forks source link

[question] Error with `--enable-external-default-callbacks` #273

Closed ssantos21 closed 11 months ago

ssantos21 commented 11 months ago

I am building secp256k1-zkp on some Ubuntu 22.04 machines with the commands below and it is working except on one of them.

$ ./autogen.sh
$ ./configure --enable-module-schnorrsig --enable-experimental --enable-module-musig --enable-external-default-callbacks --enable-benchmark=no --enable-tests=no --enable-exhaustive-tests=no
$ make

On this specific machine, the error is:

make[1]: Entering directory '/home/node/Dev/secp256k1-zkp'
  CC       src/ctime_tests-ctime_tests.o
  CC       src/libsecp256k1_la-secp256k1.lo
  CC       src/libsecp256k1_precomputed_la-precomputed_ecmult.lo
  CC       src/libsecp256k1_precomputed_la-precomputed_ecmult_gen.lo
  CCLD     libsecp256k1_precomputed.la
  CCLD     libsecp256k1.la
  CCLD     ctime_tests
/usr/local/bin/ld: ./.libs/libsecp256k1.so: undefined reference to `secp256k1_default_illegal_callback_fn'
/usr/local/bin/ld: ./.libs/libsecp256k1.so: undefined reference to `secp256k1_default_error_callback_fn'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:1261: ctime_tests] Error 1
make[1]: Leaving directory '/home/node/Dev/secp256k1-zkp'
make: *** [Makefile:1090: all] Error 2

Why is this error happening?

real-or-random commented 11 months ago

This is because you pass --enable-external-default-callbacks. If you don't need external callbacks (or you don't know what this is) then don't pass this argument. Please see the API docs for secp256k1_context_set_illegal_callback.