samr7 / vanitygen

GNU Affero General Public License v3.0
1.23k stars 629 forks source link

Install on Debian 9 (x64) #129

Open vlc33 opened 5 years ago

vlc33 commented 5 years ago

Compiling Vanity under Debian 9 (x64)

Hello I managed to compile Vanity from source , here is how I done it.

(1) problem with openssl 1.0 (old version not installed by default) As 1st compiling raises problems, people said it was because the source depends con openssl 1.0 not actual openssl 1.1+ So I downloaded openssl-1.0 from source https://www.openssl.org/source/openssl-1.0.2s.tar.gz and installed it by default it installs under /usr/ssl so it does not interfere with distribution updated openssl (-> *see next comment to install it in /usr/local/ssl) -> add to LIBS in Makefile -> add to CFLAGS in Makefile

(2) problem with pcre (old version not installed by default) normally pcre2 is installed, the old version in Debian is called pcre3 (yes) but you will also will need pcre3-dev to be installed.

(3) problem with ldl (openssl-1.0 needs it) -> add to LIBS in Makefile

Makefile fixes:

LIBS= -ldl -lpcre -lcrypto -lm -lpthread -L/usr/local/ssl/lib -I/usr/lib
      ^--(3)                             ^--(1)

CFLAGS=-ggdb -O3 -Wall -I/usr/local/ssl/include -I/usr/include
                       ^--(1)
vishalkumar2806 commented 2 years ago

adding one more extract the zip and the use this command ./config --openssldir=/usr/local/ssl make make test sudo make install

krzyk commented 2 years ago

Strange, for me it still fails in linker with:

cc -ggdb -O3 -Wall -I/usr/local/ssl/include -I/usr/include   -c -o vanitygen.o vanitygen.c
cc -ggdb -O3 -Wall -I/usr/local/ssl/include -I/usr/include   -c -o pattern.o pattern.c
cc -ggdb -O3 -Wall -I/usr/local/ssl/include -I/usr/include   -c -o util.o util.c
cc vanitygen.o pattern.o util.o -o vanitygen -ggdb -O3 -Wall -I/usr/local/ssl/include -I/usr/include -ldl -lpcre -lcrypto -lm -lpthread -L/usr/local/ssl/lib -I/usr/lib
/usr/bin/ld: /usr/local/ssl/lib/libcrypto.a(dso_dlfcn.o): in function `dlfcn_globallookup':
dso_dlfcn.c:(.text+0x17): undefined reference to `dlopen'
/usr/bin/ld: dso_dlfcn.c:(.text+0x2a): undefined reference to `dlsym'
/usr/bin/ld: dso_dlfcn.c:(.text+0x35): undefined reference to `dlclose'
/usr/bin/ld: /usr/local/ssl/lib/libcrypto.a(dso_dlfcn.o): in function `dlfcn_bind_func':
dso_dlfcn.c:(.text+0x367): undefined reference to `dlsym'
/usr/bin/ld: dso_dlfcn.c:(.text+0x432): undefined reference to `dlerror'
/usr/bin/ld: /usr/local/ssl/lib/libcrypto.a(dso_dlfcn.o): in function `dlfcn_bind_var':
dso_dlfcn.c:(.text+0x4b3): undefined reference to `dlsym'
/usr/bin/ld: dso_dlfcn.c:(.text+0x582): undefined reference to `dlerror'
/usr/bin/ld: /usr/local/ssl/lib/libcrypto.a(dso_dlfcn.o): in function `dlfcn_load':
dso_dlfcn.c:(.text+0x5ec): undefined reference to `dlopen'
/usr/bin/ld: dso_dlfcn.c:(.text+0x655): undefined reference to `dlclose'
/usr/bin/ld: dso_dlfcn.c:(.text+0x695): undefined reference to `dlerror'
/usr/bin/ld: /usr/local/ssl/lib/libcrypto.a(dso_dlfcn.o): in function `dlfcn_pathbyaddr':
dso_dlfcn.c:(.text+0x736): undefined reference to `dladdr'
/usr/bin/ld: dso_dlfcn.c:(.text+0x7a7): undefined reference to `dlerror'
/usr/bin/ld: /usr/local/ssl/lib/libcrypto.a(dso_dlfcn.o): in function `dlfcn_unload':
dso_dlfcn.c:(.text+0x808): undefined reference to `dlclose'
collect2: error: ld returned 1 exit status
make: *** [Makefile:19: vanitygen] Error 1

But I have -ldl :(

vlc33 commented 2 years ago

.