<孟婆的汤,鬼市的酒,世界那么大我想出去看看,鬼市一家有情怀的源码交易市场>

虚拟币钱包开发教程之进阶版

  • 时间:2021-06-08 20:53 编辑:网络来源 来源:网络来源 阅读:30
摘要:    1.准备你的构建系统    1.1安装MinGW(MSYS)shell    http://sourceforge.net/projects/mingw/files/Installer/mingw-get-setup.exe    从MinGW安装管理器->所有软件包->MSYS->标记以下安装:    From

    1.准备你的构建系统

    1.1安装MinGW(MSYS)shell

    http://sourceforge.net/projects/mingw/files/Installer/mingw-get-setup.exe

    从MinGW安装管理器->所有软件包->MSYS->标记以下安装:

    FromMinGWinstallationmanager->Allpackages->MSYS->markthefollowingforinstallation:

    msys-base-bin

    ...thenclickonInstallation->Applychanges

    确保没有MinGW包检查安装或从以前的安装呈现。只有上面的MSYS包应该被安装。还要确保没有安装msys-gcc和msys-w32api软件包。

    1.2安装Perl

    https://pan.baidu.com/s/1dFhKElj

    安装时使用默认值。若无法下载请联系QQ1799733624

    1.3安装Python

    http://www.python.org/ftp/python/3.3.3/python-3.3.3.amd64.msi

    安装时使用默认值。若无法下载请联系QQ1799733624

    1.4从MinGW-builds项目安装工具链:

    将i686-4.8.2-release-posix-dwarf-rt_v3-rev3.7z下载并解压到C:

    http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/4.8.2/threads-posix/dwarf/i686-4.8.2-release-posix-矮rt_v3-rev3.7z

    1.5设置系统PATH环境变量

    确保在PATH环境变量中设置了mingw-builds,MSYS,Perl和Pythonbin文件夹。在Windows7上,您的路径应该如下所示:

    C:MinGWmsys1.0in;C:mingw32in;C:Python33;C:Perlsitein;C:Perlin;%SystemRoot%system32;%SystemRoot%;%SystemRoot%System32Wbem;%SYSTEMROOT%System32WindowsPowerShellv1.0

    1.6其他检查

    C:MinGWin应该只包含mingw-get.exe。你的gcc-v输出应该是:

    $gcc-v

    Usingbuilt-inspecs.COLLECT_GCC=c:mingw32ingcc.exeCOLLECT_LTO_WRAPPER=c:/mingw32/bin/../libexec/gcc/i686-w64-mingw32/4.8.2/lto-wrapper.exeTarget:i686-w64-mingw32Configuredwith:../../../src/gcc-4.8.2/configure--host=i686-w64-mingw32--build=i686-w64-mingw32--target=i686-w64-mingw32--prefix=/mingw32--with-sysroot=/c/mingw482/i686-482-posix-dwarf-rt_v3-rev3/mingw32--with-gxx-include-dir=/mingw32/i686-w64-mingw32/include/c++--enable-shared--enable-static--disable-multilib--enable-languages=ada,c,c++,fortran,objc,obj-c++,lto--enable-libstdcxx-time=yes--enable-threads=posix--enable-libgomp--enable-libatomic--enable-lto--enable-graphite--enable-checking=release--enable-fully-dynamic-string--enable-version-specific-runtime-libs--disable-sjlj-exceptions--with-dwarf2--disable-isl-version-check--disable-cloog-version-check--disable-libstdcxx-pch--disable-libstdcxx-debug--enable-bootstrap--disable-rpath--disable-win32-registry--disable-nls--disable-werror--disable-symvers--with-gnu-as--with-gnu-ld--with-arch=i686--with-tune=generic--with-libiconv--with-system-zlib--with-gmp=/c/mingw482/prerequisites/i686-w64-mingw32-static--with-mpfr=/c/mingw482/prerequisites/i686-w64-mingw32-static--with-mpc=/c/mingw482/prerequisites/i686-w64-mingw32-static--with-isl=/c/mingw482/prerequisites/i686-w64-mingw32-static--with-cloog=/c/mingw482/prerequisites/i686-w64-mingw32-static--enable-cloog-backend=isl--with-pkgversion='i686-posix-dwarf-rev3,BuiltbyMinGW-W64project'--with-bugurl=http://sourceforge.net/projects/mingw-w64CFLAGS='-O2-pipe-I/c/mingw482/i686-482-posix-dwarf-rt_v3-rev3/mingw32/opt/include-I/c/mingw482/prerequisites/i686-zlib-static/include-I/c/mingw482/prerequisites/i686-w64-mingw32-static/include'CXXFLAGS='-O2-pipe-I/c/mingw482/i686-482-posix-dwarf-rt_v3-rev3/mingw32/opt/include-I/c/mingw482/prerequisites/i686-zlib-static/include-I/c/mingw482/prerequisites/i686-w64-mingw32-static/include'CPPFLAGS=LDFLAGS='-pipe-L/c/mingw482/i686-482-posix-dwarf-rt_v3-rev3/mingw32/opt/lib-L/c/mingw482/prerequisites/i686-zlib-static/lib-L/c/mingw482/prerequisites/i686-w64-mingw32-static/lib-Wl,--large-address-aware'Thread

    model:posixgccversion4.8.2(i686-posix-dwarf-rev3,BuiltbyMinGW-W64project)

    2.下载,解包并构建所需的依赖关系

    2.1OpenSSL

    http://www.openssl.org/source/openssl-1.0.1g.tar.gz

    从MinGWshell(C:MinGWmsys1.0msys.bat)中解压源文件到C:,重命名文件夹,然后配置并执行:

    cd/<yourdownloadpath>

    tarzxvfopenssl-1.0.1g.tar.gz-C/c

    mv/c/openssl-1.0.1g/c/openssl-1.0.1g-mgw

    cd/c/openssl-1.0.1g-mgw

    Configuremingwmake

    2.2BerkeleyDB

    http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz

    我们将使用4.8版来保存二进制钱包的兼容性。从MinGWshell解压缩源文件,配置并进行:

    cd/<yourdownloadpath>

    tarzxvfdb-4.8.30.NC.tar.gz-C/c

    mv/c/db-4.8.30.NC/c/db-4.8.30.NC-mgw

    cd/c/db-4.8.30.NC-mgw/build_unix

    ../dist/configure--disable-replication--enable-mingw--enable-cxx

    make

    2.3提升

    http://sourceforge.net/projects/boost/files/boost/1.55.0/

    下载zip或7z压缩包,将Boost解包到C:中,重命名,然后从Windows命令提示符下引导并编译:

    cdC:

    mvC:oost_1_55_0C:oost_1_55_0-mgw

    cdC:oost_1_55_0-mgw

    bootstrap.batmingw

    b2--build-type=complete--with-chrono--with-filesystem--with-program_options--with-system--with-threadtoolset=gccstage

    这将编译所需的Boost库,并将它们放到stage文件夹(C:oost_1_55_0stage)中。注意:确保不要使用tarball,因为unixEOL标记可能会中断批处理文件。

    2.4Miniupnpc

    下载http://miniupnp.free.fr/files/download.php?file=miniupnpc-1.9.tar.gz并解压缩到C:,然后从Windows命令提示符下:

    cdC:

    mvC:miniupnpc-1.9C:miniupnpc-1.9-mgw

    cdC:miniupnpc-1.9-mgw

    mingw32-make-fMakefile.mingwinitupnpc-static

    mkdirC:miniupnpc-1.9-mgwminiupnpc

    copyC:miniupnpc-1.9-mgw*.hC:miniupnpc-1.9-mgwminiupnpc

    2.5Qrencode

    然后下载http://prdownloads.sourceforge.net/libpng/libpng-1.6.9.tar.gz,然后从一个MinGWshell中解开,配置并使之:

    cd/<yourdownlaodpath>

    tarzxvflibpng-1.6.9.tar.gz-C/c

    cd/c/libpng-1.6.9

    configure

    make

    下载并解压C:目录下的http://fukuchi.org/works/qrencode/qrencode-3.4.3.tar.gz,然后配置并执行:

    cd/<yourdownlaodpath>

    tarzxvfqrencode-3.4.3.tar.gz-C/c

    mv/c/qrencode-3.4.3/c/qrencode-3.4.3-mgw

    cd/c/qrencode-3.4.3-mgw

    LIBS="../libpng-1.6.9/.libs/libpng16.a../../mingw32/i686-w64-mingw32/lib/libz.a"

    png_CFLAGS="-I../libpng-1.6.9"

    png_LIBS="-L../libpng-1.6.9/.libs"

    configure--enable-static--disable-shared

    make

    3.编译对象sharesd

    在https://github.com/Peershares/Peershares/archive/master.zip下载Peersharesmaster并解压缩到C:

    使用文本编辑器,根据您的依赖版本和位置,在C:Peershares-mastersrcmakefile.mingw中编辑INCLUDEPATHS,LIBPATHS和LIBS:

    INCLUDEPATHS=

    -I"C:oost_1_55_0-mgw"

    -I"C:db-4.8.30.NC-mgwuild_unix"

    -I"C:openssl-1.0.1g-mgwinclude"LIBPATHS=

    -L"C:oost_1_55_0-mgwstagelib"

    -L"C:db-4.8.30.NC-mgwuild_unix"

    -L"C:openssl-1.0.1g-mgw"LIBS=

    -lboost_system-mgw48-mt-s-1_55

    -lboost_filesystem-mgw48-mt-s-1_55

    -lboost_program_options-mgw48-mt-s-1_55

    -lboost_thread-mgw48-mt-s-1_55

    -ldb_cxx

    -lssl

    -lcrypto

    和...

    ifdefUSE_UPNP

    INCLUDEPATHS+=-I"C:miniupnpc-1.9-mgw"

    LIBPATHS+=-L"C:miniupnpc-1.9-mgw"

    LIBS+=-lminiupnpc-liphlpapi

    DEFS+=-DSTATICLIB-DUSE_UPNP=$(USE_UPNP)

    endif

    Upnp支持默认是禁用的。如果你想用UPNP支持集进行编译:

    USE_UPNP:=1

    从MinGWshell,编译peersharesd:

    cd/c/Peershares-master/src

    make-fmakefile.mingw

    strippeersharesd.exe

    4.用Qt4.8编译peershares-qt.exe

    4.1下载并解压Qt4.8

    http://download.qt-project.org/official_releases/qt/4.8/4.8.5/qt-everywhere-opensource-src-4.8.5.zip

    假设qt源从Windows命令提示符下解压到C:Qt4.8.5:

    cdC:Qt4.8.5

    configure-release-opensource-confirm-license-static-no-sql-sqlite-no-qt3support-no-opengl-qt-zlib-no-gif-qt-libpng-qt-libmng-no-libtiff-qt-libjpeg-no-dsp-no-vcproj-no-openssl-no-dbus-no-phonon-no-phonon-backend-no-multimedia-no-audio-backend-no-webkit-no-script-no-scripttools-no-declarative-no-declarative-debug-no-style-plastique-no-style-cleanlooks-no-style-motif-no-style-cde-nomakedemos-nomakeexamples

    mingw32-make

    现在添加“C:Qt4.8.5in;”到你的系统路径。

    4.3编辑C:Peershares-masterpeershares-qt.pro

    用你最喜欢的文本编辑器,添加依赖库的位置:

    #Dependencylibrarylocationscanbecustomizedwith:

    #BOOST_INCLUDE_PATH,BOOST_LIB_PATH,BDB_INCLUDE_PATH,

    #BDB_LIB_PATH,OPENSSL_INCLUDE_PATHandOPENSSL_LIB_PATHrespectively

    BOOST_LIB_SUFFIX=-mgw48-mt-s-1_55

    BOOST_INCLUDE_PATH=C:/boost_1_55_0-mgw

    BOOST_LIB_PATH=C:/boost_1_55_0-mgw/stage/lib

    BDB_INCLUDE_PATH=C:/db-4.8.30.NC-mgw/build_unix

    BDB_LIB_PATH=C:/db-4.8.30.NC-mgw/build_unix

    OPENSSL_INCLUDE_PATH=C:/openssl-1.0.1g-mgw/include

    OPENSSL_LIB_PATH=C:/openssl-1.0.1g-mgw

    MINIUPNPC_INCLUDE_PATH=C:/miniupnpc-1.9-mgw

    MINIUPNPC_LIB_PATH=C:/miniupnpc-1.9-mgw

    QRENCODE_INCLUDE_PATH=C:/qrencode-3.4.3-mgw

    QRENCODE_LIB_PATH=C:/qrencode-3.4.3-mgw/.libs

    标记为静态构建:

    CONFIG+=static

    4.5编译peershares-qt.exe

    请注意,如果您跳过peersharesd编译,或者如果您清理了源文件夹,则需要在继续之前编译libleveldb.a和libmemenv.a库。如果您编译peersharesd.exe,请跳过此步骤。从MinGW外壳:

    cd/C/Peershares-master/src/leveldb

    TARGET_OS=NATIVE_WINDOWSmakelibleveldb.alibmemenv.a

    从Windows命令提示配置并使:

    cdC:Peershares-master

    qmake"USE_UPNP=-"peershares-qt.pro

    mingw32-make-fMakefile.Release


【版权与免责声明】如发现内容存在版权问题,烦请联系平台客服及时删除,我们将及时沟通与处理。 本站内容除了鬼市 ( http://www.guisss.com/ )标注原创外,其它均为网友转载内容,涉及言论、版权与本站无关。