When building with CMake, only one type of the library, either shared or static, is built and optionally installed.
In the “Release process” document, the “Check installation with CMake” step implies testing the shared library, and specifies the -L
and -l
compiler flags manually (despite the fact that CMake also generates and installs the libsecp256k1.pc
file).
This approach may be fragile, as it depends on the environment. For example, if the shared library isn’t built or the -L
path is incorrect, the toolchain may silently fall back to a static library from a default location, e.g., /usr/local/lib/libsecp256k1.a
. This could cause the test to pass even when the shared library wasn’t installed correctly.
One possible solution is to link explicitly against the shared library using its absolute path:
0gcc -o ecdsa examples/ecdsa.c -I $dir/include $dir/lib*/libsecp256k1.so -Wl,-rpath,"$dir/lib",-rpath,"$dir/lib64" && ./ecdsa