Unable to Compile?

Open
#5 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
c, cpp

Research direction

Start with the secp256k1 API calls at contracthashtool.c lines 246 and 290, then compare their arguments with the headers from the linked installation. Check the Makefile and compile command for the intended library version. Done means the project compiles successfully with a specified compatible secp256k1 version or documented API target.

Written by the indexing model from the issue text.

Description

Despite linking the latest secp256k1, I'm unable to compile this as-is?

$   make CXXFLAGS="-I../secp256k1/install/usr/local/include -L../secp256k1/install/usr/local/lib -static"
g++ -O2 -Wall -I../secp256k1/install/usr/local/include -L../secp256k1/install/usr/local/lib -static -I. contracthashtool.c stolen.cpp uint256.cpp crypto/ripemd160.cpp crypto/sha2.cpp -o contracthashtool -lsecp256k1
contracthashtool.c: In function ‘int main(int, char**)’:
contracthashtool.c:246:75: error: cannot convert ‘unsigned char*’ to ‘secp256k1_pubkey_t*’ for argument ‘2’ to ‘int secp256k1_ec_pubkey_tweak_add(const secp256k1_context_t*, secp256k1_pubkey_t*, const unsigned char*)’
     if (secp256k1_ec_pubkey_tweak_add(secp256k1_ctx, keys_work[i], 33, res) == 0) {
                                                                           ^
contracthashtool.c:290:67: error: cannot convert ‘unsigned char*’ to ‘secp256k1_pubkey_t*’ for argument ‘2’ to ‘int secp256k1_ec_pubkey_create(const secp256k1_context_t*, secp256k1_pubkey_t*, const unsigned char*)’
   if (secp256k1_ec_pubkey_create(secp256k1_ctx, pub, &len, priv, 1) != 1 || len != 33)
                                                                   ^
make: *** [all] Error 1

Seems like this needs to be pushed upstream or a target version specified?

Dominant language
C++
Stars
90
Forks
20
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.