Compiling bitcoin-qt error: ld.exe: cannot find -lsecp256k1

1

I have followed the guide "Building headless Bitcoin and Bitcoin-qt on Windows" but with a more recent altcoin source code to test.

The compilation stop on ld.exe: cannot find -lsecp256k1

Is one step missing to generate this missing dll ?

My qt-pro includes:

win32:BOOST_LIB_SUFFIX=-mgw49-mt-s-1_57
win32:BOOST_INCLUDE_PATH=C:/Deps/boost_1_57_0
win32:BOOST_LIB_PATH=C:/Deps/boost_1_57_0/stage/lib
win32:BDB_INCLUDE_PATH=c:/deps/db-4.8.30.NC/build_unix/
win32:BDB_LIB_PATH=c:/deps/db-4.8.30.NC/build_unix
win32:OPENSSL_INCLUDE_PATH=C:/Deps/openssl-1.0.2k/include/
win32:OPENSSL_LIB_PATH=C:/Deps/openssl-1.0.2k
win32:MINIUPNPC_INCLUDE_PATH=C:/Deps/
win32:MINIUPNPC_LIB_PATH=C:/Deps/miniupnpc/
win32:LIBPNG_INCLUDE_PATH=C:/Deps/libpng-1.6.1/
win32:LIBPNG_LIB_PATH=C:/Deps/libpng-1.6.18
win32:QRENCODE_INCLUDE_PATH=C:/Deps/qrencode-3.4.4
win32:QRENCODE_LIB_PATH=C:/Deps/qrencode-3.4.4/.libs
win32:SECP256K1_LIB_PATH = C:/Crypto/mycrypto/src/secp256k1/
win32:SECP256K1_INCLUDE_PATH = C:/Crypto/mycrypto/src/secp256k1/include

Boody

Posted 2018-03-13T10:16:03.870

Reputation: 31

Welcome to Bitcoin.SE! That is a fairly old guide for Bitcoin Core v0.9.4, v0.10rc4 or, v0.8.6. Usually, these days compiling Bitcoin Core for Windows is done in an Ubuntu environment or similar (build-windows.md) but, without a link to the altcoin source repository, I cannot even check what its build documents say. Probably it uses lsecp256k1 instead of or as well as secp256k1.

Willtech 2018-03-13T11:37:25.857

@Willtech thanks for your welcome. I have created two learning coins (the last one is https://github.com/JustCuriously/locavore) just to see how it work, build an explorer etc... it's of course copy of other old fork but it's to understand the process. The linux qt has been compiled but I'm not able to compile the Windows qt. If a use the new method (build-windows.md) on the old code I will have many depends errors now ?

Boody 2018-03-14T08:14:30.227

Your standard build instructions are here, do they work?

Willtech 2018-03-14T08:20:56.550

more or less since I have not been able to compile the Windows version, I have not yet updated the method. I just commit the qt version for linux (with qt5). I'm looking for a complete version of code to study, with MN, POW, POS ... but every time I clone the git source and try to compile something is missing .. it seems that dev have something to hide or don't like to share secret :-)Boody 2018-03-14T17:15:47.773

Just out of interest, what happens if addthe two paths for lsecp256k1 just pointing them to secp256k1?Willtech 2018-03-14T20:46:50.323

I restart from scratch my install and check my deps... no I have another error :build\key.o:key.cpp:(.text+0x8f3): undefined reference to secp256k1_ecdsa_sign_recoverable' ./build\key.o:key.cpp:(.text+0x919): undefined reference tosecp256k1_ecdsa_recoverable_signature_serialize_compact' ./build\key.o:key.cpp:(.text+0x98a): undefined reference to secp256k1_ecdsa_recoverable_signature_serialize_compact' C:/mingw32/bin/../lib/gcc/i686-w64-mingw32/4.9.2/../../../../i686-w64-mingw32/bin/ld.exe: ./build\key.o: bad reloc address 0x1c in section.text$Boody 2018-03-16T15:04:45.253

Do you still have the path for secp256k1 defined also?Willtech 2018-03-16T20:21:43.203

yes, still defined so, I just remove everything (i'm working on a VM) to avoid duplicate install or different version.Boody 2018-03-16T21:11:37.087

You can reset your git repository with git clean -fdx before trying to build if that saves some effort, but that is unrelated to your issueWilltech 2018-03-17T00:40:04.267

Answers

1

Problem resolved ! There was an error during the secp256k1 compilation process (MINGW32 under windows), adding:

LT_INIT([win32-dll])

into the secp256k1/configure.ac has resolved the compilation error.

Boody

Posted 2018-03-13T10:16:03.870

Reputation: 31