Two days I'm trying to compile miner for Win x86 platform..
Visual Studio 2013 first errors was like this:
LNK2001: unresolved external symbol _libssh2_version
As solution was to move variable declaration at top of functions:
json_t *status;
// some code
status = json_object_get(res_val, "status");
instead of:
json_t *status = json_object_get(res_val, "status");
When I tried to compile x86, VS asked me for libs: "libcurl.x84.lib openssl.x84.lib zlib.x84.lib", which was found here:
http://sourceforge.net/projects/curlforwindows/files/?source=navbarNext errors was stronger than me (
Error 1 error LNK2001: unresolved external symbol _libssh2_version C:\Users\Bingo\Documents\Visual Studio 2013\tpruvot\cpuminer-multi-1.1-multi\libcurl.x86.lib(version.obj) cpuminer
Error 2 error LNK2001: unresolved external symbol _libssh2_exit C:\Users\Bingo\Documents\Visual Studio 2013\tpruvot\cpuminer-multi-1.1-multi\libcurl.x86.lib(easy.obj) cpuminer
Error 3 error LNK2001: unresolved external symbol _libssh2_init C:\Users\Bingo\Documents\Visual Studio 2013\tpruvot\cpuminer-multi-1.1-multi\libcurl.x86.lib(easy.obj) cpuminer
This is the end of VS story. I installed Mingw. Than in msys console from sources was compilled and installed curl, openssl, jansson, pthreads.
Compilation fails with:
$ make
make all-recursive
make[1]: Entering directory `/go/tpruvot'
Making all in compat
make[2]: Entering directory `/go/tpruvot/compat'
make[3]: Entering directory `/go/tpruvot/compat'
make[3]: Nothing to be done for `all-am'.
make[3]: Leaving directory `/go/tpruvot/compat'
make[2]: Leaving directory `/go/tpruvot/compat'
make[2]: Entering directory `/go/tpruvot'
gcc -std=gnu99 -DHAVE_CONFIG_H -I. -fno-strict-aliasing -I. -Wno-pointer-sign
-Wno-pointer-to-int-cast -g -O2 -MT cpuminer-cpu-miner.o -MD -MP -MF .deps/c
puminer-cpu-miner.Tpo -c -o cpuminer-cpu-miner.o `test -f 'cpu-miner.c' || echo
'./'`cpu-miner.c
In file included from miner.h:31:0,
from cpu-miner.c:48:
c:\mingw\include\pthread.h:321:8: error: redefinition of 'struct timespec'
struct timespec {
^
In file included from c:\mingw\include\unistd.h:95:0,
from cpu-miner.c:21:
c:\mingw\include\parts\time.h:65:8: note: originally defined here
struct timespec
^
In file included from cpu-miner.c:51:0:
compat/winansi.h:10:0: warning: "fileno" redefined [enabled by default]
#define fileno(fd) _fileno(fd)
^
In file included from cpu-miner.c:16:0:
c:\mingw\include\stdio.h:595:0: note: this is the location of the previous defin
ition
#define fileno(__F) ((__F)->_file)
^
cpu-miner.c: In function 'proper_exit':
cpu-miner.c:462:3: warning: implicit declaration of function 'GetConsoleWindow'
[-Wimplicit-function-declaration]
HWND hcon = GetConsoleWindow();
^
cpu-miner.c:462:15: warning: initialization makes pointer from integer without a
cast [enabled by default]
HWND hcon = GetConsoleWindow();
^
cpu-miner.c: In function 'main':
cpu-miner.c:3009:15: warning: initialization makes pointer from integer without
a cast [enabled by default]
HWND hcon = GetConsoleWindow();
^
make[2]: *** [cpuminer-cpu-miner.o] Error 1
make[2]: Leaving directory `/go/tpruvot'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/go/tpruvot'
make: *** [all] Error 2
After googling, structure in pthread.h was commented.
Next errors I still can't resolve:
make all-recursive
make[1]: Entering directory `/go/tpruvot'
Making all in compat
make[2]: Entering directory `/go/tpruvot/compat'
make[3]: Entering directory `/go/tpruvot/compat'
make[3]: Nothing to be done for `all-am'.
make[3]: Leaving directory `/go/tpruvot/compat'
make[2]: Leaving directory `/go/tpruvot/compat'
make[2]: Entering directory `/go/tpruvot'
gcc -std=gnu99 -Wno-pointer-sign -Wno-pointer-to-int-cast -DCURL_STATICLIB -DO
PENSSL_NO_ASM -DUSE_ASM -O3 -Wall -D_REENTRANT -fmerge-all-constants -I/usr/loc
al/include -I/usr/local/ssl/include icon.o -L/usr/local/ssl/lib -L/usr/local/lib
icon.o -L/usr/local/ssl/lib -L/usr/local/lib -o cpuminer.exe cpuminer-cpu-min
er.o cpuminer-util.o cpuminer-api.o cpuminer-sysinfos.o sha3/cpuminer-sph_keccak
.o sha3/cpuminer-sph_hefty1.o sha3/cpuminer-sph_groestl.o sha3/cpuminer-sph_skei
n.o sha3/cpuminer-sph_bmw.o sha3/cpuminer-sph_jh.o sha3/cpuminer-sph_shavite.o s
ha3/cpuminer-sph_blake.o sha3/cpuminer-mod_blakecoin.o sha3/cpuminer-sph_luffa.o
sha3/cpuminer-sph_cubehash.o sha3/cpuminer-sph_simd.o sha3/cpuminer-sph_echo.o
sha3/cpuminer-sph_hamsi.o sha3/cpuminer-sph_fugue.o sha3/cpuminer-sph_sha2.o sha
3/cpuminer-sph_sha2big.o sha3/cpuminer-sph_shabal.o sha3/cpuminer-sph_whirlpool.
o crypto/cpuminer-blake2s.o crypto/cpuminer-oaes_lib.o crypto/cpuminer-c_keccak.
o crypto/cpuminer-c_groestl.o crypto/cpuminer-c_blake256.o crypto/cpuminer-c_jh.
o crypto/cpuminer-c_skein.o crypto/cpuminer-hash.o crypto/cpuminer-aesb.o lyra2/
cpuminer-Lyra2.o lyra2/cpuminer-Sponge.o algo/cpuminer-animecoin.o algo/cpuminer
-axiom.o algo/cpuminer-blake.o algo/cpuminer-blakecoin.o algo/cpuminer-blake2.o
algo/cpuminer-bmw256.o algo/cpuminer-c11.o algo/cpuminer-cryptonight.o algo/cpum
iner-drop.o algo/cpuminer-fresh.o algo/cpuminer-groestl.o algo/cpuminer-heavy.o
algo/cpuminer-ink.o algo/cpuminer-luffa.o algo/cpuminer-lyra2re.o algo/cpuminer-
myr-groestl.o algo/cpuminer-keccak.o algo/cpuminer-pentablake.o algo/cpuminer-qu
ark.o algo/cpuminer-neoscrypt.o algo/cpuminer-nist5.o algo/cpuminer-pluck.o algo
/cpuminer-qubit.o algo/cpuminer-scrypt.o algo/cpuminer-sha2.o algo/cpuminer-skei
n.o algo/cpuminer-skein2.o algo/cpuminer-s3.o algo/cpuminer-x11.o algo/cpuminer-
x13.o algo/cpuminer-x14.o algo/cpuminer-x15.o algo/cpuminer-zr5.o asm/cpuminer-n
eoscrypt_asm.o -lcurl -lz -lssl -lcrypto -ljansson -lpthreadGC2
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot fin
d -lz
collect2.exe: error: ld returned 1 exit status
make[2]: *** [cpuminer.exe] Error 1
make[2]: Leaving directory `/go/tpruvot'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/go/tpruvot'
make: *** [all] Error 2
C:\MinGW\bin\strip.exe: 'cpuminer.exe': No such file
And when I installing zlib-1.2.8 I get:
cpuminer-api.o:api.c:(.text+0xd5a): undefined reference to `closesocket@4'
cpuminer-api.o:api.c:(.text+0xdf3): undefined reference to `closesocket@4'
cpuminer-api.o:api.c:(.text+0x12d5): undefined reference to `send@16'
cpuminer-api.o:api.c:(.text+0x13aa): undefined reference to `send@16'
cpuminer-api.o:api.c:(.text+0x1432): undefined reference to `send@16'
algo/cpuminer-cryptonight.o:cryptonight.c:(.text+0x4cd): undefined reference to
`mul128'
algo/cpuminer-cryptonight.o:cryptonight.c:(.text+0x5bf): undefined reference to
`mul128'
algo/cpuminer-cryptonight.o:cryptonight.c:(.text+0xba3): undefined reference to
`fast_aesb_pseudo_round_mut'
algo/cpuminer-cryptonight.o:cryptonight.c:(.text+0xbbe): undefined reference to
`fast_aesb_pseudo_round_mut'
algo/cpuminer-cryptonight.o:cryptonight.c:(.text+0xbd9): undefined reference to
`fast_aesb_pseudo_round_mut'
algo/cpuminer-cryptonight.o:cryptonight.c:(.text+0xbf4): undefined reference to
`fast_aesb_pseudo_round_mut'
algo/cpuminer-cryptonight.o:cryptonight.c:(.text+0xc0f): undefined reference to
`fast_aesb_pseudo_round_mut'
algo/cpuminer-cryptonight.o:cryptonight.c:(.text+0xc2a): more undefined referenc
es to `fast_aesb_pseudo_round_mut' follow
algo/cpuminer-cryptonight.o:cryptonight.c:(.text+0xd87): undefined reference to
`fast_aesb_single_round'
algo/cpuminer-cryptonight.o:cryptonight.c:(.text+0xdfd): undefined reference to
`mul128'
algo/cpuminer-cryptonight.o:cryptonight.c:(.text+0xe79): undefined reference to
`fast_aesb_single_round'
algo/cpuminer-cryptonight.o:cryptonight.c:(.text+0xeef): undefined reference to
`mul128'
algo/cpuminer-cryptonight.o:cryptonight.c:(.text+0x100a): undefined reference to
`fast_aesb_pseudo_round_mut'
algo/cpuminer-cryptonight.o:cryptonight.c:(.text+0x1045): undefined reference to
`fast_aesb_pseudo_round_mut'
algo/cpuminer-cryptonight.o:cryptonight.c:(.text+0x1084): undefined reference to
`fast_aesb_pseudo_round_mut'
algo/cpuminer-cryptonight.o:cryptonight.c:(.text+0x10c3): undefined reference to
`fast_aesb_pseudo_round_mut'
algo/cpuminer-cryptonight.o:cryptonight.c:(.text+0x1102): undefined reference to
`fast_aesb_pseudo_round_mut'
algo/cpuminer-cryptonight.o:cryptonight.c:(.text+0x113d): more undefined referen
ces to `fast_aesb_pseudo_round_mut' follow
algo/cpuminer-pluck.o:pluck.c:(.text+0x3348): undefined reference to `htonl@4'
algo/cpuminer-scrypt.o:scrypt.c:(.text+0x50): undefined reference to `sha256_use
_4way'
algo/cpuminer-scrypt.o:scrypt.c:(.text+0x7b4): undefined reference to `scrypt_co
re'
algo/cpuminer-scrypt.o:scrypt.c:(.text+0xbfe): undefined reference to `sha256_tr
ansform_4way'
algo/cpuminer-scrypt.o:scrypt.c:(.text+0xc18): undefined reference to `sha256_in
it_4way'
algo/cpuminer-scrypt.o:scrypt.c:(.text+0xc70): undefined reference to `sha256_tr
ansform_4way'
algo/cpuminer-scrypt.o:scrypt.c:(.text+0xc7c): undefined reference to `sha256_in
it_4way'
algo/cpuminer-scrypt.o:scrypt.c:(.text+0xcd3): undefined reference to `sha256_tr
ansform_4way'
algo/cpuminer-scrypt.o:scrypt.c:(.text+0xd02): undefined reference to `sha256_tr
ansform_4way'
algo/cpuminer-scrypt.o:scrypt.c:(.text+0xe3a): undefined reference to `sha256_tr
ansform_4way'
algo/cpuminer-scrypt.o:scrypt.c:(.text+0xe68): undefined reference to `sha256_tr
ansform_4way'
algo/cpuminer-scrypt.o:scrypt.c:(.text+0xeeb): undefined reference to `scrypt_co
re'
algo/cpuminer-scrypt.o:scrypt.c:(.text+0xf05): undefined reference to `scrypt_co
re'
algo/cpuminer-scrypt.o:scrypt.c:(.text+0xf1f): undefined reference to `scrypt_co
re'
algo/cpuminer-scrypt.o:scrypt.c:(.text+0xf32): undefined reference to `scrypt_co
re'
algo/cpuminer-scrypt.o:scrypt.c:(.text+0xf81): undefined reference to `sha256_tr
ansform_4way'
algo/cpuminer-scrypt.o:scrypt.c:(.text+0xfa0): undefined reference to `sha256_tr
ansform_4way'
algo/cpuminer-scrypt.o:scrypt.c:(.text+0xfbc): undefined reference to `sha256_tr
ansform_4way'
algo/cpuminer-scrypt.o:scrypt.c:(.text+0xffd): undefined reference to `sha256_tr
ansform_4way'
algo/cpuminer-sha2.o:sha2.c:(.text+0x3e84): undefined reference to `sha256_use_4
way'
algo/cpuminer-sha2.o:sha2.c:(.text+0x9732): undefined reference to `sha256d_ms_4
way'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: .rsrc merg
e failure: duplicate leaf: type: e (GROUP_ICON) name: 0 lang: 409
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: .rsrc merg
e failure: duplicate leaf: type: 3 (ICON) name: 3 lang: 409
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: .rsrc merg
e failure: duplicate leaf: type: 3 (ICON) name: 2 lang: 409
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: .rsrc merg
e failure: duplicate leaf: type: 3 (ICON) name: 1 lang: 409
collect2.exe: error: ld returned 1 exit status
make[2]: *** [cpuminer.exe] Error 1
make[2]: Leaving directory `/go/tpruvot'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/go/tpruvot'
make: *** [all] Error 2
C:\MinGW\bin\strip.exe: 'cpuminer.exe': No such file
When uninstalling, it fails with a previous error.
What should I try more? What I forget?
p.s.
I already read "you need to install the dev packages", but what ***-dev packages are still pending in my set?