Pages:
Author

Topic: [HOWTO] compile altcoin for windows on linux using mxe and mingw - page 6. (Read 49127 times)

newbie
Activity: 58
Merit: 0
Could you provide detail step to downgrade Openssl version 1 ?
hero member
Activity: 1638
Merit: 507
The snake which cannot cast its skin has to die
How do we fix thee BIGNUM error, I think that could help a lot.


downgrade the libssl version you're using

I tried that, but I don't think I was successful, how does one do that?

Edit: and which version does one downgrade to?

Download the version from openssl.org, go down one version at a time from the one you're using.

Here's a build script you can modify accordingly to your system setup and work from there...

Code:
#!/bin/bash

# Working setup to cross-compile Windows binaries for Qt Coin hosted on a
# Ubuntu 16.04 box using non-Canonical ppas for MXE and Qt5.7:
# deb http://pkg.mxe.cc/repos/apt/debian wheezy main

# Doesn't seem to pass the QT directives through, though.

# Basic path bindings

PATH=/path/to/mxe/usr/bin:$PATH
MXE_PATH=/path/to/mxe
MXE_INCLUDE_PATH=/path/to/mxe/usr/i686-w64-mingw32.static/include
MXE_LIB_PATH=/path/to/mxe/usr/i686-w64-mingw32.static/lib

# Belt and braces

CXXFLAGS="-std=gnu++11 -march=i686"
LDFLAGS="-march=i686"
target="i686-w64-mingw32.static"

# Particulars for cross-compiling

export BOOST_LIB_SUFFIX=-mt
export BOOST_THREAD_LIB_SUFFIX=_win32-mt
export BOOST_INCLUDE_PATH=${MXE_INCLUDE_PATH}/boost
export BOOST_LIB_PATH=${MXE_LIB_PATH}
export OPENSSL_INCLUDE_PATH=${MXE_INCLUDE_PATH}/openssl
export OPENSSL_LIB_PATH=${MXE_LIB_PATH}
export BDB_INCLUDE_PATH=${MXE_INCLUDE_PATH}
export BDB_LIB_PATH=${MXE_LIB_PATH}
export MINIUPNPC_INCLUDE_PATH=${MXE_INCLUDE_PATH}
export MINIUPNPC_LIB_PATH=${MXE_INCLUDE_LIB}
export MINIUPNP_STATICLIB=${MXE_INCLUDE_LIB}
export QRENCODE_INCLUDE_PATH=/path/to/qrencode/install/include
export QRENCODE_LIB_PATH=/path/to/qrencode/install/lib
export SECP256K1_LIB_PATH=/home/ader/coins/AmsterdamCoin/src/secp256k1/libs
export SECP256K1_INCLUDE_PATH=/home/ader/coins/AmsterdamCoin/src/secp256k1/include
export QMAKE_LRELEASE=${MXE_PATH}/usr/${target}/qt5/bin/lrelease

# Call qmake to create Makefile.[Release|Debug]

${target}-qmake-qt5 \
    MXE=1 \
    USE_O3=1 \
    USE_QRCODE=1 \
    USE_UPNPC=1 \
    FIRST_CLASS_MESSAGING=1 \
    RELEASE=1 \
    BOOST_LIB_SUFFIX=${BOOST_LIB_SUFFIX} \
    BOOST_THREAD_LIB_SUFFIX=${BOOST_THREAD_LIB_SUFFIX} \
    BOOST_INCLUDE_PATH=${BOOST_INCLUDE_PATH} \
    BOOST_LIB_PATH=${BOOST_LIB_PATH} \
    OPENSSL_INCLUDE_PATH=${OPENSSL_INCLUDE_PATH} \
    OPENSSL_LIB_PATH=${OPENSSL_LIB_PATH} \
    BDB_INCLUDE_PATH=${BDB_INCLUDE_PATH} \
    BDB_LIB_PATH=${BDB_LIB_PATH} \
    MINIUPNPC_INCLUDE_PATH=${MINIUPNPC_INCLUDE_PATH} \
    MINIUPNPC_LIB_PATH=${MINIUPNPC_LIB_PATH} \
    MINIUPNP_STATICLIB=${MINIUPNP_STATICLIB} \
    QRENCODE_INCLUDE_PATH=/path/to/qrencode/install/include \
    QRENCODE_LIB_PATH=/path/to/qrencode/install/lib \
    QMAKE_LRELEASE=${QMAKE_LRELEASE} COIN-name.pro
    SECP256K1_LIB_PATH=/home/ader/coins/DEPS/src/secp256k1/.libs \
    SECP256K1_INCLUDE_PATH=/home/ader/coins/DEPS/src/secp256k1/include \

# Go for it. If successful, Windows binary will be written out to ./release/COin-name-qt.exe
cd src/leveldb
TARGET_OS=NATIVE_WINDOWS make libleveldb.a libmemenv.a CC=~path/to/mxe/usr/bin/i686-w64-mingw32.static-gcc CXX=/path/to/mxe/usr/bin/i686-w64-mingw32.static-g++

make -f Makefile.Release  CXXFLAGS="-DQT_GUI -DQT_NO_PRINTER -std=gnu++11 -march=x86_64" LDFLAGS="-march=x86_64"
jr. member
Activity: 260
Merit: 6
How do we fix thee BIGNUM error, I think that could help a lot.


downgrade the libssl version you're using

I tried that, but I don't think I was successful, how does one do that?

Edit: and which version does one downgrade to?
hero member
Activity: 1638
Merit: 507
The snake which cannot cast its skin has to die
How do we fix thee BIGNUM error, I think that could help a lot.


downgrade the libssl version you're using
jr. member
Activity: 260
Merit: 6
How do we fix thee BIGNUM error, I think that could help a lot.
newbie
Activity: 58
Merit: 0
Final stage to compile it. it has error below.

Any solution ?

src/bignum.h:531:61: error: cannot convert 'const CBigNum*' to 'const BIGNUM* {aka const bignum_st*}' for argument '1' to 'int BN_is_prime(const BIGNUM*, int, void (*)(int, int, void*), BN_CTX*, void*)'
         int ret = BN_is_prime(this, checks, NULL, pctx, NULL);
                                                             ^
src/bignum.h: In member function 'bool CBigNum::isOne() const':
src/bignum.h:539:30: error: cannot convert 'const CBigNum*' to 'const BIGNUM* {aka const bignum_st*}' for argument '1' to 'int BN_is_one(const BIGNUM*)'
         return BN_is_one(this);
                              ^
src/bignum.h: In member function 'bool CBigNum::operator!() const':
src/bignum.h:545:31: error: cannot convert 'const CBigNum*' to 'const BIGNUM* {aka const bignum_st*}' for argument '1' to 'int BN_is_zero(const BIGNUM*)'
         return BN_is_zero(this);
                               ^
src/bignum.h: In member function 'CBigNum& CBigNum::operator+=(const CBigNum&)':
src/bignum.h:550:35: error: cannot convert 'CBigNum*' to 'BIGNUM* {aka bignum_st*}' for argument '1' to 'int BN_add(BIGNUM*, const BIGNUM*, const BIGNUM*)'
         if (!BN_add(this, this, &b))
                                   ^
src/bignum.h: In member function 'CBigNum& CBigNum::operator*=(const CBigNum&)':
src/bignum.h:564:41: error: cannot convert 'CBigNum*' to 'BIGNUM* {aka bignum_st*}' for argument '1' to 'int BN_mul(BIGNUM*, const BIGNUM*, const BIGNUM*, BN_CTX*)'
         if (!BN_mul(this, this, &b, pctx))
                                         ^
src/bignum.h: In member function 'CBigNum& CBigNum::operator<<=(unsigned int)':
src/bignum.h:583:41: error: cannot convert 'CBigNum*' to 'BIGNUM* {aka bignum_st*}' for argument '1' to 'int BN_lshift(BIGNUM*, const BIGNUM*, int)'
         if (!BN_lshift(this, this, shift))
                                         ^
src/bignum.h: In member function 'CBigNum& CBigNum::operator>>=(unsigned int)':
src/bignum.h:594:28: error: cannot convert 'CBigNum*' to 'const BIGNUM* {aka const bignum_st*}' for argument '1' to 'int BN_cmp(const BIGNUM*, const BIGNUM*)'
         if (BN_cmp(&a, this) > 0)
                            ^
src/bignum.h:600:41: error: cannot convert 'CBigNum*' to 'BIGNUM* {aka bignum_st*}' for argument '1' to 'int BN_rshift(BIGNUM*, const BIGNUM*, int)'
         if (!BN_rshift(this, this, shift))
                                         ^
src/bignum.h: In member function 'CBigNum& CBigNum::operator++()':
src/bignum.h:609:47: error: cannot convert 'CBigNum*' to 'BIGNUM* {aka bignum_st*}' for argument '1' to 'int BN_add(BIGNUM*, const BIGNUM*, const BIGNUM*)'
         if (!BN_add(this, this, BN_value_one()))
                                               ^
src/bignum.h: In member function 'CBigNum& CBigNum::operator--()':
src/bignum.h:626:45: error: cannot convert 'CBigNum*' to 'BIGNUM* {aka bignum_st*}' for argument '1' to 'int BN_sub(BIGNUM*, const BIGNUM*, const BIGNUM*)'
         if (!BN_sub(&r, this, BN_value_one()))
                                             ^
src/bignum.h: In function 'const CBigNum operator+(const CBigNum&, const CBigNum&)':
src/bignum.h:653:27: error: cannot convert 'CBigNum*' to 'BIGNUM* {aka bignum_st*}' for argument '1' to 'int BN_add(BIGNUM*, const BIGNUM*, const BIGNUM*)'
     if (!BN_add(&r, &a, &b))
                           ^
src/bignum.h: In function 'const CBigNum operator-(const CBigNum&, const CBigNum&)':
src/bignum.h:661:27: error: cannot convert 'CBigNum*' to 'BIGNUM* {aka bignum_st*}' for argument '1' to 'int BN_sub(BIGNUM*, const BIGNUM*, const BIGNUM*)'
     if (!BN_sub(&r, &a, &b))
                           ^
src/bignum.h: In function 'const CBigNum operator-(const CBigNum&)':
src/bignum.h:669:43: error: cannot convert 'CBigNum*' to 'const BIGNUM* {aka const bignum_st*}' for argument '1' to 'int BN_is_negative(const BIGNUM*)'
     BN_set_negative(&r, !BN_is_negative(&r));
                                           ^
src/bignum.h: In function 'const CBigNum operator*(const CBigNum&, const CBigNum&)':
src/bignum.h:677:33: error: cannot convert 'CBigNum*' to 'BIGNUM* {aka bignum_st*}' for argument '1' to 'int BN_mul(BIGNUM*, const BIGNUM*, const BIGNUM*, BN_CTX*)'
     if (!BN_mul(&r, &a, &b, pctx))
                                 ^
src/bignum.h: In function 'const CBigNum operator/(const CBigNum&, const CBigNum&)':
src/bignum.h:686:39: error: cannot convert 'CBigNum*' to 'BIGNUM* {aka bignum_st*}' for argument '1' to 'int BN_div(BIGNUM*, BIGNUM*, const BIGNUM*, const BIGNUM*, BN_CTX*)'
     if (!BN_div(&r, NULL, &a, &b, pctx))
                                       ^
src/bignum.h: In function 'const CBigNum operator%(const CBigNum&, const CBigNum&)':
src/bignum.h:695:35: error: cannot convert 'CBigNum*' to 'BIGNUM* {aka bignum_st*}' for argument '1' to 'int BN_nnmod(BIGNUM*, const BIGNUM*, const BIGNUM*, BN_CTX*)'
     if (!BN_nnmod(&r, &a, &b, pctx))
                                   ^
src/bignum.h: In function 'const CBigNum operator<<(const CBigNum&, unsigned int)':
src/bignum.h:703:33: error: cannot convert 'CBigNum*' to 'BIGNUM* {aka bignum_st*}' for argument '1' to 'int BN_lshift(BIGNUM*, const BIGNUM*, int)'
     if (!BN_lshift(&r, &a, shift))
                                 ^
src/bignum.h: In function 'bool operator==(const CBigNum&, const CBigNum&)':
src/bignum.h:715:83: error: cannot convert 'const CBigNum*' to 'const BIGNUM* {aka const bignum_st*}' for argument '1' to 'int BN_cmp(const BIGNUM*, const BIGNUM*)'
 perator==(const CBigNum& a, const CBigNum& b) { return (BN_cmp(&a, &b) == 0); }
                                                                      ^
src/bignum.h: In function 'bool operator!=(const CBigNum&, const CBigNum&)':
src/bignum.h:716:83: error: cannot convert 'const CBigNum*' to 'const BIGNUM* {aka const bignum_st*}' for argument '1' to 'int BN_cmp(const BIGNUM*, const BIGNUM*)'
 perator!=(const CBigNum& a, const CBigNum& b) { return (BN_cmp(&a, &b) != 0); }
                                                                      ^
src/bignum.h: In function 'bool operator<=(const CBigNum&, const CBigNum&)':
src/bignum.h:717:83: error: cannot convert 'const CBigNum*' to 'const BIGNUM* {aka const bignum_st*}' for argument '1' to 'int BN_cmp(const BIGNUM*, const BIGNUM*)'
 perator<=(const CBigNum& a, const CBigNum& b) { return (BN_cmp(&a, &b) <= 0); }
                                                                      ^
src/bignum.h: In function 'bool operator>=(const CBigNum&, const CBigNum&)':
src/bignum.h:718:83: error: cannot convert 'const CBigNum*' to 'const BIGNUM* {aka const bignum_st*}' for argument '1' to 'int BN_cmp(const BIGNUM*, const BIGNUM*)'
 perator>=(const CBigNum& a, const CBigNum& b) { return (BN_cmp(&a, &b) >= 0); }
                                                                      ^
src/bignum.h: In function 'bool operator<(const CBigNum&, const CBigNum&)':
src/bignum.h:719:83: error: cannot convert 'const CBigNum*' to 'const BIGNUM* {aka const bignum_st*}' for argument '1' to 'int BN_cmp(const BIGNUM*, const BIGNUM*)'
 operator<(const CBigNum& a, const CBigNum& b)  { return (BN_cmp(&a, &b) < 0); }
                                                                       ^
src/bignum.h: In function 'bool operator>(const CBigNum&, const CBigNum&)':
src/bignum.h:720:83: error: cannot convert 'const CBigNum*' to 'const BIGNUM* {aka const bignum_st*}' for argument '1' to 'int BN_cmp(const BIGNUM*, const BIGNUM*)'
newbie
Activity: 58
Merit: 0
Can we add QR code on QT wallet  ?

Regards
newbie
Activity: 22
Merit: 0
I already tried to configure and do the make install before and it didn't change anything. I tested it all again, including the ldconfig (just to make sure), but this option didn't solve the issue
brand new
Activity: 0
Merit: 0
Try reinstalling/recompiling the MXE suite - I have no idea whether that will help but it's a starting poiint.
newbie
Activity: 7
Merit: 0
newbie
Activity: 38
Merit: 0
I changed
    
Code:
LIBS += $$join(SECP256K1_LIB_PATH,,-L,) -lsecp256k1
to
    
Code:
LIBS += $$join(SECP256K1_LIB_PATH,,-L,) -L/mnt/COINNAME/src/secp256k1
and got past
    
Code:
/mnt/mxe/usr/bin/i686-w64-mingw32.static-ld: cannot find -lsecp256k1

There's other errors now so I'm not sure if it's the proper fix but it might help some people.
newbie
Activity: 38
Merit: 0
I figured out

Code:
/mnt/mxe/usr/bin/i686-w64-mingw32.static-ld: cannot find -lboost_system-mgw49-mt-s-1_57
/mnt/mxe/usr/bin/i686-w64-mingw32.static-ld: cannot find -lboost_filesystem-mgw49-mt-s-1_57
/mnt/mxe/usr/bin/i686-w64-mingw32.static-ld: cannot find -lboost_program_options-mgw49-mt-s-1_57
/mnt/mxe/usr/bin/i686-w64-mingw32.static-ld: cannot find -lboost_chrono-mgw49-mt-s-1_57
collect2: error: ld returned 1 exit status

Turns out this is from developers deleting things from the repo to make your life harder. With this issue, you are likely missing the share, contrib, and doc folders.

This one is still an issue for me:
Code:
/mnt/mxe/usr/bin/i686-w64-mingw32.static-ld: cannot find -lsecp256k1
hero member
Activity: 1638
Merit: 507
The snake which cannot cast its skin has to die
@agricoin which coin you compiling ?
member
Activity: 201
Merit: 10
hero member
Activity: 1638
Merit: 507
The snake which cannot cast its skin has to die
member
Activity: 201
Merit: 10
res.o
./build/key.o:key.cpp:(.text+0x106): undefined reference to `secp256k1_ec_seckey_verify'
./build/key.o:key.cpp:(.text+0x334): undefined reference to `secp256k1_ec_seckey_verify'
./build/key.o:key.cpp:(.text+0x381): undefined reference to `secp256k1_ec_seckey_verify'
./build/key.o:key.cpp:(.text+0x42b): undefined reference to `secp256k1_ec_pubkey_create'
./build/key.o:key.cpp:(.text+0x461): undefined reference to `secp256k1_ec_pubkey_serialize'
./build/key.o:key.cpp:(.text+0x70f): undefined reference to `secp256k1_ec_seckey_verify'
./build/key.o:key.cpp:(.text+0x77a): undefined reference to `secp256k1_context_destroy'
./build/key.o:key.cpp:(.text+0x7d1): undefined reference to `secp256k1_nonce_function_rfc6979'
./build/key.o:key.cpp:(.text+0x80c): undefined reference to `secp256k1_ecdsa_sign_recoverable'
./build/key.o:key.cpp:(.text+0x832): undefined reference to `secp256k1_ecdsa_recoverable_signature_serialize_compact'
./build/key.o:key.cpp:(.text+0x89c): undefined reference to `secp256k1_ecdsa_recoverable_signature_serialize_compact'
./build/key.o:key.cpp:(.text+0x97e): undefined reference to `secp256k1_nonce_function_rfc6979'
./build/key.o:key.cpp:(.text+0x9a6): undefined reference to `secp256k1_ecdsa_sign'
./build/key.o:key.cpp:(.text+0x9e5): undefined reference to `secp256k1_ecdsa_signature_serialize_der'
./build/key.o:key.cpp:(.text+0x12c5): undefined reference to `secp256k1_ec_pubkey_create'
./build/key.o:key.cpp:(.text+0x1398): undefined reference to `secp256k1_ec_pubkey_serialize'
./build/key.o:key.cpp:(.text+0x2377): undefined reference to `secp256k1_ec_privkey_tweak_add'
./build/key.o:key.cpp:(.text+0x261a): undefined reference to `secp256k1_ec_seckey_verify'
./build/key.o:key.cpp:(.text+0x2812): undefined reference to `secp256k1_context_create'
./build/key.o:key.cpp:(.text+0x2840): undefined reference to `secp256k1_context_randomize'
./build/pubkey.o:pubkey.cpp:(.text+0x3b): undefined reference to `secp256k1_ecdsa_signature_parse_compact'
./build/pubkey.o:pubkey.cpp:(.text+0x24c): undefined reference to `secp256k1_ecdsa_signature_parse_compact'
./build/pubkey.o:pubkey.cpp:(.text+0x385): undefined reference to `secp256k1_ecdsa_signature_parse_compact'
./build/pubkey.o:pubkey.cpp:(.text+0x42e): undefined reference to `secp256k1_ec_pubkey_parse'
./build/pubkey.o:pubkey.cpp:(.text+0x46e): undefined reference to `secp256k1_ecdsa_signature_normalize'
./build/pubkey.o:pubkey.cpp:(.text+0x48e): undefined reference to `secp256k1_ecdsa_verify'
./build/pubkey.o:pubkey.cpp:(.text+0x509): undefined reference to `secp256k1_ecdsa_recoverable_signature_parse_compact'
./build/pubkey.o:pubkey.cpp:(.text+0x531): undefined reference to `secp256k1_ecdsa_recover'
./build/pubkey.o:pubkey.cpp:(.text+0x574): undefined reference to `secp256k1_ec_pubkey_serialize'
./build/pubkey.o:pubkey.cpp:(.text+0x643): undefined reference to `secp256k1_ec_pubkey_parse'
./build/pubkey.o:pubkey.cpp:(.text+0x6b2): undefined reference to `secp256k1_ec_pubkey_parse'
./build/pubkey.o:pubkey.cpp:(.text+0x6e7): undefined reference to `secp256k1_ec_pubkey_serialize'
./build/pubkey.o:pubkey.cpp:(.text+0x8d9): undefined reference to `secp256k1_ec_pubkey_parse'
./build/pubkey.o:pubkey.cpp:(.text+0x901): undefined reference to `secp256k1_ec_pubkey_tweak_add'
./build/pubkey.o:pubkey.cpp:(.text+0x936): undefined reference to `secp256k1_ec_pubkey_serialize'
./build/pubkey.o:pubkey.cpp:(.text+0xd1e): undefined reference to `secp256k1_ecdsa_signature_normalize'
./build/pubkey.o:pubkey.cpp:(.text+0xd69): undefined reference to `secp256k1_context_create'
./build/pubkey.o:pubkey.cpp:(.text+0xdfe): undefined reference to `secp256k1_context_destroy'
collect2: error: ld returned 1 exit status


Any Idea how to fix this?
legendary
Activity: 1638
Merit: 1036
newbie
Activity: 26
Merit: 0
Hello everyone,

I am getting an error saying

Code:
make: *** [build/txdb-leveldb.o] Error 1

Everything seems fine, it compiles for couple minutes, then gives this error. Couldn't solve.
newbie
Activity: 47
Merit: 0
as promised I managed to get an older fork to work
I replaced

cd /mnt
git clone https://github.com/mxe/mxe.git

with

cd /mnt
git clone https://github.com/abhisit/mxe.git

it works for my needs. maybe somebody else will find a better version
newbie
Activity: 47
Merit: 0
they appear to have updated MXE and it's causing the bignum errors. think it's the openssl version. I'll post more when I figure it out
Pages:
Jump to: