Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem compiling bitcoin-tool #28

Open
marceloincessant opened this issue Jan 19, 2018 · 6 comments
Open

Problem compiling bitcoin-tool #28

marceloincessant opened this issue Jan 19, 2018 · 6 comments

Comments

@marceloincessant
Copy link

Hello, has anyone had these compiling bugs fixed?

git clone https://github.com/matja/bitcoin-tool
Cloning into 'bitcoin-tool'...
remote: Counting objects: 259, done.
remote: Total 259 (delta 0), reused 0 (delta 0), pack-reused 259
Receiving objects: 100% (259/259), 103.26 KiB | 2.95 MiB/s, done.
Resolving deltas: 100% (169/169), done.
root@ip-172-31-8-228:~ # cd bitcoin-tool/
root@ip-172-31-8-228:~/bitcoin-tool # make test
make: "/root/bitcoin-tool/Makefile" line 2: Missing dependency operator
make: "/root/bitcoin-tool/Makefile" line 6: Need an operator
make: "/root/bitcoin-tool/Makefile" line 8: Need an operator
make: "/root/bitcoin-tool/Makefile" line 16: Need an operator
make: "/root/bitcoin-tool/Makefile" line 21: Need an operator
make: "/root/bitcoin-tool/Makefile" line 23: Missing dependency operator
make: "/root/bitcoin-tool/Makefile" line 24: warning: duplicate script for target "ifeq" ignored
make: "/root/bitcoin-tool/Makefile" line 5: warning: using previous script for "ifeq" defined here
make: "/root/bitcoin-tool/Makefile" line 25: Need an operator
make: Fatal errors encountered -- cannot continue
make: stopped in /root/bitcoin-tool

@matja
Copy link
Owner

matja commented Jan 19, 2018

Which version of make and which OS is this?

@marceloincessant
Copy link
Author

gmake 4.2.1

Now the error is:

gmake test
cc -ansi -Wall -O2 -Wno-long-long -DOS_FAMILY=UNIX -c -o main.o main.c
cc -ansi -Wall -O2 -Wno-long-long -DOS_FAMILY=UNIX -c -o keys.o keys.c
cc -ansi -Wall -O2 -Wno-long-long -DOS_FAMILY=UNIX -c -o hash.o hash.c
cc -ansi -Wall -O2 -Wno-long-long -DOS_FAMILY=UNIX -c -o base58.o base58.c
In file included from base58.c:14:
/usr/include/malloc.h:3:2: error: "<malloc.h> has been replaced by <stdlib.h>"
#error "<malloc.h> has been replaced by <stdlib.h>"
^
1 error generated.
gmake: *** [: base58.o] Error 1

@marceloincessant
Copy link
Author

OS Version:

uname -a
FreeBSD ip-172-31-8-228 10.3-STABLE FreeBSD 10.3-STABLE #0 r315417: Thu Mar 16 16:37:32 UTC 2017 root@releng1.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC amd64

@matja
Copy link
Owner

matja commented Jan 19, 2018

Thanks for the quick reply, it appears that the OS detection directives were incorrect and I didn't specify that GNU make is required (although you found that out).

I've pushed a new version to the master branch which I've additionally tested on:

  • FreeBSD 10.4 amd64 with clang 3.4.1
  • FreeBSD 11.1 amd64 with clang 4.0.0

I've also updated the 'requirements' section in the README.md to specify which packages are required on FreeBSD.

@marceloincessant
Copy link
Author

marceloincessant commented Jan 22, 2018

Thank you so much!!!

gmake test
./tests.sh
check 1 - convert Casascius mini private key format to address
check 2 - hex private key to compressed address
check 3 - hex private key to uncompressed address
check 4 - WIF uncompressed private key to address
check 6 - raw private key file, to uncompressed base58check WIF private key
check 7 - raw private key file, to compressed base58check WIF private key
check 8 - hex ripemd160 hash of public key, to base58check address
check 9 - base58check address, to hex ripemd160 hash of public key
Failed to decode Base58Check input (checksum failure).
Attempting to fix Base58Check input by changing up to 3 characters ...
Changing 1 character ...
from: 5J5sKGFLpZ4bQXEHiEmDp9Fuf7k36FqF3WoaNKHKDHnLfJYnkUR
to: 5J5sKGFLpZ4bQXEHiEmDp9Fuf7k36FqF3woaNKHKDHnLfJYnkUR
^
Base58Check input has been corrected after 1969 combinations (0.000046% chance of error).
check 10 - fix base58check address, by changing 1 character
check 11 - convert 'Hash 160' to address
check 12 - convert 'SHA256' to address
check prefix1 - WIF compressed private key to address (bitcoin)
check prefix2 - WIF compressed private key to address (bitcoin-testnet)
check prefix3 - WIF compressed private key to address (litecoin)
check prefix4 - WIF compressed private key to address (dogecoin)
check prefix5 - WIF compressed private key to address (feathercoin)
check prefix6 - WIF compressed private key to address (quarkcoin)
check prefix7 - WIF compressed private key to address (namecoin)
all tests passed

The only requirements not specified is the xxd that is installed aside the vim editor. This is a helpful tool!

@PsyShark
Copy link

PsyShark commented Oct 20, 2018

Problem when compiling with Win10x64 (Cygwin compiler).

$ make
x86_64-w64-mingw32-gcc -o bitcoin-tool main.o keys.o hash.o base58.o result.o combination.o applog.o utility.o prefix.o -L /usr/lib -lcrypto -lssl
main.o:main.c:(.text+0x13bd): undefined reference to __errno' main.o:main.c:(.text+0x1593): undefined reference to __errno'
main.o:main.c:(.text+0x1c7f): undefined reference to __assert_func' main.o:main.c:(.text+0x1fbb): undefined reference to __assert_func'
main.o:main.c:(.text+0x2173): undefined reference to __errno' main.o:main.c:(.text+0x21cc): undefined reference to __assert_func'
main.o:main.c:(.rdata$.refptr._impure_ptr[.refptr._impure_ptr]+0x0): undefined reference to `_impure_ptr'
collect2: error: ld returned 1 exit status
make: *** [Makefile:56: bitcoin-tool] Error 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants