JulyIghor / QtBitcoinTrader

Secure multi crypto exchange trading client
https://centrabit.com/downloads/
720 stars 371 forks source link

which needed version for build windows 10? #277

Closed sta111on closed 2 years ago

sta111on commented 2 years ago

I tried build that I saw old issues closed #233. but error occur need update Qt 5.10 not supported for QFontMetrics::horizontalAdvance.

updated version Qt 5.12.0 + MinGW 7.3 64bit and Win64 OpenSSL v1.1.1m can build success but execute segment fault.

recently your commit 43416904ae10de2ad93914c2f97a3d510b4c1e2e Which Qt, Open SSL, Compiler all of versions using exactly for build success on windows 10 64bit? I think you compile statically option right? Please detail option and version.

Here is I changed QtBitcoinTrader_Desktop.pro file

win32 {
    LIBS += -llibssl -llibcrypto -lz
    INCLUDEPATH += "D:\OpenSSL-Win64\include"
    LIBS += -L"D:\OpenSSL-Win64\lib"
JulyIghor commented 2 years ago

Hello. You need OpenSSL library that built with the same compiler you use. You can try to compile OpenSSL by your own or find another builds. Both OpenSSL 1.0 and 1.1 versions supported by Qt Bitcoin Trader.

sta111on commented 2 years ago

Here is my success environment versions and how to way compile for windows 10 64bit version

Qt 5.12.12 compiled by 64bit mingw 7.3.0 version OpenSSL official source 1.1.1m MSYS2 64bit

OpenSSL compile command on MSYS2 console as Administrator execute on Windows 10 Pro 21H2 version (my computer but other version also okay I guess)

1. Install toolchain  

# pacman -S --needed base-devel mingw-w64-i686-toolchain mingw-w64-x86_64-toolchain git subversion mercurial mingw-w64-i686-cmake mingw-w64-x86_64-cmake

now recently gcc version 11.2.0 (Rev2, Built by MSYS2 project)

2. uncompress and make command 

your home directory move and uncompress file like this..

# tar xvzf openssl-1.1.1m.tar.gz
...
# cd openssl-1.1.1m

/C/ mean is install C: drive path

# perl Configure mingw64 --prefix=/C/OpenSSL-x64
 OpenSSL has been successfully configured
...

# make depend
check file dependency...

# make -j 16 
-j 16 mean is Multithread compile option depend on your CPU core (my CPU AMD Ryzen 7 2700x 8 core processor model have each core two thread possible 8x2=16)

# make install
install include header, library, dll files on your window system directory thats why need windows administrator permission

3. add lines to QtBitcoinTrader_Desktop.pro file for compile option.

31-34 line block like below this append option.

win32 {
    INCLUDEPATH += "C:\OpenSSL-x64\include"
    LIBS += -L"C:\OpenSSL-x64\lib"

I tried 32bit compile environment but it still failed. If someone succeeds, please reply to this comment.

Good luck!

sta111on commented 2 years ago

I did success again for 32bit compile.

Qt 15.5.2 32bit compile by mingw 8.1.0 32bit included open source version online installer OpenSSL official source 1.1.1m MSYS2 32bit included 64bit installer. more infomation go to https://www.msys2.org/wiki/MSYS2-installation/

OpenSSL 32bit compile way is same source code file like 64bit environment but need compile 32bit compiler option 
# perl Configure mingw --prefix=/C/OpenSSL

.pro file modified

win32 {
    INCLUDEPATH += "C:\OpenSSL\include"
    LIBS += -L"C:\OpenSSL\lib"

MSYS2 32bit console execute use gcc 11.2.0 32bit version for compile OpenSSL same like 64bit but option changed mingw64 -> mingw and directory name.

not much different but I choice Qt 15.5.2 version because include 32bit compiler and environment console setting.

to @JulyIghor I think good for this summary for wiki page for beginner.