A. 在Windows平台下怎麼編譯boost 1.57 for android
這里是使用NDK進行編譯boost的但肯定對我有用吧。。經過一番折騰終於編譯成功,,高興,呵呵! 轉載
下面將主要的過程記錄下來:
1、下載boost 源碼:
Boost for Android
Boost for android is a set of tools to compile the main part of the Boost C++ Libraries for the Android platform.
Currently supported boost versions are 1.45.0, 1.48.0 and 1.49.0.
因此下載最新的 1.49 版本,下載完成後進行打補丁
2、下載補丁代碼
boost-1_49_0
3、打補丁代碼
boost_1_49_0.tar.bz2 放在android的 external 下解壓:
tar -xjvf external/boost_1_49_0.tar.bz2
將boost-1_49_0.patch放在external\boost_1_49_0下面根目錄執行:
patch -Np1 -d external/boost_1_49_0 < external/boost_1_49_0/boost-1_49_0.patch
4、編寫boost的makefile文件,即Android.mk
LOCAL_PATH:= $(call my-dir)
common_SRC_FILES := \
libs/thread/src/pthread/thread.cpp \
libs/thread/src/pthread/once.cpp \
common_SRC_FILES += \
libs/filesystem/v3/src/codecvt_error_category.cpp \
libs/filesystem/v3/src/operations.cpp \
libs/filesystem/v3/src/path.cpp \
libs/filesystem/v3/src/path_traits.cpp \
libs/filesystem/v3/src/portability.cpp \
libs/filesystem/v3/src/utf8_codecvt_facet.cpp \
libs/system/src/error_code.cpp \
libs/system/src/local_free_on_destruction \
include $(CLEAR_VARS)
LOCAL_MODULE:= libboost
LOCAL_SRC_FILES := $(common_SRC_FILES)
prebuilt_stdcxx_PATH := prebuilts/ndk/current/sources/cxx-stl/gnu-libstdc++
LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/boost \
$(prebuilt_stdcxx_PATH)/include \
$(prebuilt_stdcxx_PATH)/libs/$(TARGET_CPU_ABI)/include/ \
LOCAL_C_INCLUDES += \
$(prebuilt_stdcxx_PATH)/include \
$(prebuilt_stdcxx_PATH)/libs/$(TARGET_CPU_ABI)/include/ \
$(prebuilt_supccxx_PATH)/include
LOCAL_CFLAGS += -fvisibility=hidden -lpthread
LOCAL_CPPFLAGS += -fexceptions -frtti
LOCAL_SHARED_LIBRARIES := libc libstdc++ libstlport
LOCAL_LDFLAGS += -L$(prebuilt_stdcxx_PATH)/libs/$(TARGET_CPU_ABI) -lgnustl_static -lsupc++
LOCAL_MODULE_TAGS := optional
include $(BUILD_SHARED_LIBRARY)
比較重要的是上面 紅色 部分文字
最後編譯生成:
target thumb C++: libboost <= external/boost_1_49_0/libs/thread/src/pthread/thread.cpp
target thumb C++: libboost <= external/boost_1_49_0/libs/thread/src/pthread/once.cpp
target thumb C++: libboost <= external/boost_1_49_0/libs/filesystem/v3/src/codecvt_error_category.cpp
target thumb C++: libboost <= external/boost_1_49_0/libs/filesystem/v3/src/operations.cpp
target thumb C++: libboost <= external/boost_1_49_0/libs/filesystem/v3/src/path.cpp
target thumb C++: libboost <= external/boost_1_49_0/libs/filesystem/v3/src/path_traits.cpp
target thumb C++: libboost <= external/boost_1_49_0/libs/filesystem/v3/src/portability.cpp
target thumb C++: libboost <= external/boost_1_49_0/libs/filesystem/v3/src/utf8_codecvt_facet.cpp
target thumb C++: libboost <= external/boost_1_49_0/libs/system/src/error_code.cpp
target SharedLib: libboost (out/target/proct/godbox/obj/SHARED_LIBRARIES/libboost_intermediates/LINKED/libboost.so)
target Symbolic: libboost (out/target/proct/godbox/symbols/system/lib/libboost.so)
target Strip: libboost (out/target/proct/godbox/obj/lib/libboost.so)
Install: out/target/proct/godbox/system/lib/libboost.so
成功生成 libboost.so 庫
B. 如何在windows平台下編譯比特幣bitcoin客戶端
很多朋友都知道如何在linux平台如何編譯比特幣程序,但是,到了windows平台,
就會感覺到無從下手. 其實, 比特幣程序是跨平台的.
你要編譯windows版的比特幣程序,基本上有兩種方法,一種是在linux平台
(推薦ubuntu 13.10)通過交叉編譯的方法來編譯.另外一種,就是直接在windows平台編譯.
我想,你既然要在windows平台使用,我就詳細介紹一下如何在windwows平台編譯比特幣程序.
我的平台:windows7
第一步:安裝變編譯環境QT和MINGW,msys
1、msys是一個在windows平台模擬shell的程序。
下載安裝程序之後,通過安裝管理程序,按安裝以下內容:
From MinGW installation manager -> All packages -> MSYS
選中以下安裝包
msys-base-bin
msys-autoconf-bin
msys-automake-bin
msys-libtool-bin
點 apply changes開始安裝。他會自動下載安裝好。
需要注意的是,確保不要安裝msys-gcc和msys-w32api ,因為這兩個包和我們的編譯系統發生沖突。
很多人出現一些莫名其妙的問題,就是因為這兩個包。
2、安裝 MinGW-builds
下載並解壓縮 i686-4.8.2-release-posix-dwarf-rt_v3-rev3.7z 到C盤根目錄 C:\
注意我的目錄結構。你盡量和我一樣。
3、設置PATH環境變數,將C:\mingw32\bin;添加到第一個。
4、在命令行模式下輸入 gc -v 會得到以下內容
c:\gcc -v
Using built-in specs.
COLLECT_GCC=c:\mingw32\bin\gcc.exe
COLLECT_LTO_WRAPPER=c:/mingw32/bin/../libexec/gcc/i686-w64-mingw32/4.8.2/lto-wrapper.exe
Target: i686-w64-mingw32
Configured with: ../../../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, Built by MinGW-W64 project' --with-bugurl=http://sourceforge.net/projects/mingw-w64 CFLAGS='-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: posix
gcc version 4.8.2 (i686-posix-dwarf-rev3, Built by MinGW-W64 project)
至此,你的開發環境已經搭建好了,很簡單吧
第二部分:下載bitcoin引用的外部庫
我們把它們全部放在 C:\deps目錄下
2.1 安裝OpenSSL下載:
進入啟動 MinGw shell 比如目錄:(C:\MinGW\msys\1.0\msys.bat)運行這個msys.bat,就會啟動一個shell環境,提示符是$
輸入命令
cd /c/deps/
tar xvfz openssl-1.0.1g.tar.gz
cd openssl-1.0.1g
Configure no-shared no-dso mingw
make
等待幾分鍾後,就把openssl編譯好了。
2.2 下載Berkeley DB
我們推薦使用 4.8版本
同樣在msys shell環境下輸入以下命令
cd /c/deps/
tar xvfz db-4.8.30.NC.tar.gz
cd db-4.8.30.NC/build_unix
../dist/configure --enable-mingw --enable-cxx --disable-shared --disable-replication
make
等待編譯
2.3 安裝Boost
msys命令:
cd C:\deps\boost_1_55_0\
bootstrap.bat mingw
b2 --build-type=complete --with-chrono --with-filesystem --with-program_options --with-system --with-thread toolset=gcc variant=release link=static threading=multi runtime-link=static stage
2.4 安裝Miniupnpc
cd C:\deps\miniupnpc
mingw32-make -f Makefile.mingw init upnpc-static
2.5下載 protoc 和 libprotobuf:
msys shell命令
cd /c/deps/protobuf-2.5.0
configure --disable-shared
make
2.6 qrencode:
命令
cd /c/deps/libpng-1.6.10
configure --disable-shared
make
ode:
cd /c/deps/qrencode-3.4.3
LIBS="../libpng-1.6.10/.libs/libpng16.a ../../mingw32/i686-w64-mingw32/lib/libz.a" \
png_CFLAGS="-I../libpng-1.6.10" \
png_LIBS="-L../libpng-1.6.10/.libs" \
configure --enable-static --disable-shared --without-tools
make
2.7 安裝 Qt 5 庫
在 windows命令行輸入:
set INCLUDE=C:\deps\libpng-1.6.10;C:\deps\openssl-1.0.1g\include
set LIB=C:\deps\libpng-1.6.10\.libs;C:\deps\openssl-1.0.1g
cd C:\Qt\5.2.1
configure.bat -release -opensource -confirm-license -static -make libs -no-sql-sqlite -no-opengl -system-zlib -qt-pcre -no-icu -no-gif -system-libpng -no-libjpeg -no-freetype -no-angle -no-vcproj -openssl-linked -no-dbus -no-audio-backend -no-wmf-backend -no-qml-debug
mingw32-make
set PATH=%PATH%;C:\Qt\5.2.1\bin
cd C:\Qt\qttools-opensource-src-5.2.1
qmake qttools.pro
mingw32-make
3. 下載Bitcoin 0.9.1
在msys shell下輸入以下命令行:
cp /c/deps/libpng-1.6.10/.libs/libpng16.a /c/deps/libpng-1.6.10/.libs/libpng.a
cd /c/bitcoin-0.9.1
./autogen.sh
CPPFLAGS="-I/c/deps/boost_1_55_0 \
-I/c/deps/db-4.8.30.NC/build_unix \
-I/c/deps/openssl-1.0.1g/include \
-I/c/deps \
-I/c/deps/protobuf-2.5.0/src \
-I/c/deps/libpng-1.6.10 \
-I/c/deps/qrencode-3.4.3" \
LDFLAGS="-L/c/deps/boost_1_55_0/stage/lib \
-L/c/deps/db-4.8.30.NC/build_unix \
-L/c/deps/openssl-1.0.1g \
-L/c/deps/miniupnpc \
-L/c/deps/protobuf-2.5.0/src/.libs \
-L/c/deps/libpng-1.6.10/.libs \
-L/c/deps/qrencode-3.4.3/.libs" \
./configure \
--disable-upnp-default \
--disable-tests \
--with-qt-incdir=/c/Qt/5.2.1/include \
--with-qt-libdir=/c/Qt/5.2.1/lib \
--with-qt-bindir=/c/Qt/5.2.1/bin \
--with-qt-plugindir=/c/Qt/5.2.1/plugins \
--with-boost-system=mgw48-mt-s-1_55 \
--with-boost-filesystem=mgw48-mt-s-1_55 \
--with-boost-program-options=mgw48-mt-s-1_55 \
--with-boost-thread=mgw48-mt-s-1_55 \
--with-boost-chrono=mgw48-mt-s-1_55 \
--with-protoc-bindir=/c/deps/protobuf-2.5.0/src
make
strip src/bitcoin-cli.exe
strip src/bitcoind.exe
strip src/qt/bitcoin-qt.exe
這樣,你就得到了變異好的 bitcoin-cli.exe和bitcoind.exe ,bitcoin-qt.exe(windows QT圖形界面的錢包軟體)
C. 如何在windows平台下編譯比特幣bitcoin客戶端
第一步:安裝變編譯環境QT和MINGW,msys
1、msys是一個在windows平台模擬shell的程序。
訪問http://sourceforge.net/projects/mingw/files/Installer/mingw-get-setup.exe/download
下載安裝程序之後,通過安裝管理程序,按安裝以下內容:
From MinGW installation manager -> All packages -> MSYS
選中以下安裝包
msys-base-bin
msys-autoconf-bin
msys-automake-bin
msys-libtool-bin
點 apply changes開始安裝。他會自動下載安裝好。
需要注意的是,確保不要安裝msys-gcc和msys-w32api ,因為這兩個包和我們的編譯系統發生沖突。
很多人出現一些莫名其妙的問題,就是因為這兩個包。
2、安裝 MinGW-builds
訪問
http://sourceforge.net/projects/mingw-w64/files/Toolchains targetting Win32/Personal Builds/mingw-builds/4.8.2/threads-posix/dwarf/i686-4.8.2-release-posix-dwarf-rt_v3-rev3.7z/download
下載並解壓縮 i686-4.8.2-release-posix-dwarf-rt_v3-rev3.7z 到C盤根目錄 C:\
注意我的目錄結構。你盡量和我一樣。
3、設置PATH環境變數,將C:\mingw32\bin;添加到第一個。
4、在命令行模式下輸入 gc -v 會得到以下內容
c:\gcc -v
Using built-in specs.
COLLECT_GCC=c:\mingw32\bin\gcc.exe
COLLECT_LTO_WRAPPER=c:/mingw32/bin/../libexec/gcc/i686-w64-mingw32/4.8.2/lto-wrapper.exe
Target: i686-w64-mingw32
Configured with: ../../../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, Built by MinGW-W64 project' --with-bugurl=http://sourceforge.net/projects/mingw-w64 CFLAGS='-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: posix
gcc version 4.8.2 (i686-posix-dwarf-rev3, Built by MinGW-W64 project)
至此,你的開發環境已經搭建好了,很簡單吧
第二部分:下載bitcoin引用的外部庫
我們把它們全部放在 C:\deps目錄下
2.1 安裝OpenSSL下載:http://www.openssl.org/source/openssl-1.0.1g.tar.gz
進入啟動 MinGw shell 比如目錄:(C:\MinGW\msys\1.0\msys.bat)運行這個msys.bat,就會啟動一個shell環境,提示符是$
輸入命令
cd /c/deps/
tar xvfz openssl-1.0.1g.tar.gz
cd openssl-1.0.1g
Configure no-shared no-dso mingw
make
等待幾分鍾後,就把openssl編譯好了。
2.2 下載Berkeley DB 訪問: http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz
我們推薦使用 4.8版本
同樣在msys shell環境下輸入以下命令
cd /c/deps/
tar xvfz db-4.8.30.NC.tar.gz
cd db-4.8.30.NC/build_unix
../dist/configure --enable-mingw --enable-cxx --disable-shared --disable-replication
make
等待編譯
2.3 安裝Boost,下載地址: http://sourceforge.net/projects/boost/files/boost/1.55.0/
msys命令:
cd C:\deps\boost_1_55_0\
bootstrap.bat mingw
b2 --build-type=complete --with-chrono --with-filesystem --with-program_options --with-system --with-thread toolset=gcc variant=release link=static threading=multi runtime-link=static stage
2.4 安裝Miniupnpc 下載地址: http://miniupnp.free.fr/files/download.php?file=miniupnpc-1.9.tar.gz
cd C:\deps\miniupnpc
mingw32-make -f Makefile.mingw init upnpc-static
2.5下載 protoc 和 libprotobuf:
Download and unpack http://protobuf.googlecode.com/files/protobuf-2.5.0.zip
msys shell命令
cd /c/deps/protobuf-2.5.0
configure --disable-shared
make
2.6 qrencode:
下載地址: http://prdownloads.sourceforge.net/libpng/libpng-1.6.10.tar.gz?download
命令
cd /c/deps/libpng-1.6.10
configure --disable-shared
make
下載 http://fukuchi.org/works/qrencode/qrencode-3.4.3.tar.gz ode:
cd /c/deps/qrencode-3.4.3
LIBS="../libpng-1.6.10/.libs/libpng16.a ../../mingw32/i686-w64-mingw32/lib/libz.a" \
png_CFLAGS="-I../libpng-1.6.10" \
png_LIBS="-L../libpng-1.6.10/.libs" \
configure --enable-static --disable-shared --without-tools
make
2.7 安裝 Qt 5 庫
下載和解壓縮
http://download.qt-project.org/official_releases/qt/5.2/5.2.1/submoles/qtbase-opensource-src-5.2.1.7z
http://download.qt-project.org/official_releases/qt/5.2/5.2.1/submoles/qttools-opensource-src-5.2.1.7z
在 windows命令行輸入:
set INCLUDE=C:\deps\libpng-1.6.10;C:\deps\openssl-1.0.1g\include
set LIB=C:\deps\libpng-1.6.10\.libs;C:\deps\openssl-1.0.1g
cd C:\Qt\5.2.1
configure.bat -release -opensource -confirm-license -static -make libs -no-sql-sqlite -no-opengl -system-zlib -qt-pcre -no-icu -no-gif -system-libpng -no-libjpeg -no-freetype -no-angle -no-vcproj -openssl-linked -no-dbus -no-audio-backend -no-wmf-backend -no-qml-debug
mingw32-make
set PATH=%PATH%;C:\Qt\5.2.1\bin
cd C:\Qt\qttools-opensource-src-5.2.1
qmake qttools.pro
mingw32-make
3. 下載Bitcoin 0.9.1 地址: https://github.com/bitcoin/bitcoin/archive/v0.9.1.zip
在msys shell下輸入以下命令行:
cp /c/deps/libpng-1.6.10/.libs/libpng16.a /c/deps/libpng-1.6.10/.libs/libpng.a
cd /c/bitcoin-0.9.1
./autogen.sh
CPPFLAGS="-I/c/deps/boost_1_55_0 \
-I/c/deps/db-4.8.30.NC/build_unix \
-I/c/deps/openssl-1.0.1g/include \
-I/c/deps \
-I/c/deps/protobuf-2.5.0/src \
-I/c/deps/libpng-1.6.10 \
-I/c/deps/qrencode-3.4.3" \
LDFLAGS="-L/c/deps/boost_1_55_0/stage/lib \
-L/c/deps/db-4.8.30.NC/build_unix \
-L/c/deps/openssl-1.0.1g \
-L/c/deps/miniupnpc \
-L/c/deps/protobuf-2.5.0/src/.libs \
-L/c/deps/libpng-1.6.10/.libs \
-L/c/deps/qrencode-3.4.3/.libs" \
./configure \
--disable-upnp-default \
--disable-tests \
--with-qt-incdir=/c/Qt/5.2.1/include \
--with-qt-libdir=/c/Qt/5.2.1/lib \
--with-qt-bindir=/c/Qt/5.2.1/bin \
--with-qt-plugindir=/c/Qt/5.2.1/plugins \
--with-boost-system=mgw48-mt-s-1_55 \
--with-boost-filesystem=mgw48-mt-s-1_55 \
--with-boost-program-options=mgw48-mt-s-1_55 \
--with-boost-thread=mgw48-mt-s-1_55 \
--with-boost-chrono=mgw48-mt-s-1_55 \
--with-protoc-bindir=/c/deps/protobuf-2.5.0/src
make
strip src/bitcoin-cli.exe
strip src/bitcoind.exe
strip src/qt/bitcoin-qt.exe
這樣,你就得到了變異好的 bitcoin-cli.exe和bitcoind.exe ,bitcoin-qt.exe(windows QT圖形界面的錢包軟體)
D. 比特幣大家了解過嗎
我做了好幾個月了,可以肯定的說非常靠譜!現在比特幣超過2萬美金了,以後應該會上漲到10萬美金。也就是說,現在免費賺的比特幣還可以享受升值。通過我的鏈接注冊https://cryptotabbrowser.com/20800059
我已經提款超過5次,絕對沒問題,所以我現在已經購買了5倍的boost,賺起來超快,我現在每小時差不多9600HS/h!
第一步:通過鏈接下載安裝瀏覽器(鏈接如下)https://cryptotabbrowser.com/20800059
第二步:打開CryptoTab主頁,點擊藍色 DOWNLOAD CRYPTOTAB BROWSER ,下載完成後安裝即可。(目前普遍瀏覽器都有網頁翻譯功能,方便您瀏覽。)
第六步:顯示下圖說明登錄成功了。只要保持CryptoTab一直打開就能一直挖礦了~
當您的產量到達0.00001BTC後點擊左/右角的三條杠。(手機和電腦略有不同)
第七步:由於剛提現一次,目前還不夠最低提現額度,所以接下來的界面沒有截圖,大家只需要輸入您的BTC地址,提幣數量,點擊人機驗證即可跳轉啦。
本文來源:andehui的網賺博客
本文地址:http://honeygain.cn/2020/11/468/
版權聲明:轉載請註明Honeygain.cn
E. windows 怎麼安裝boost
先從官網(www.boost.org)下載最新版的BOOST源碼,如圖所示
我這里下的是zip的那個
第2步:
編譯源代碼(放心.這里是傻瓜式的操作,很容易操作)
(1)先把源代碼放在E盤,例如 E:oost_1_53_0
(2)在源代碼中找到一個批處理bootstrap.bat,運行即可
此時會彈出Building Boost.Jam之類,過一會之後,源代碼中新增了1個文件bjam.exe
(3)運行bjame.exe即能編譯了(花費時間很長,大概20分
F. VS2013 boost.python 編譯錯誤,請教一下
確認文件boost/python.hpp存在
#include包含語句,應該放在源文件首部,其它代碼之前(其它#include之後)
嘗試增加作用域定義:
using namespace boost::python;
G. 怎樣在TP錢包幣安生態鏈開發虛擬貨幣
具體可以參考以下步驟:
1.第一步:准備編譯環境。代碼都是需要編譯的,因此需要准備編譯環境和工具,您需要下載mingw(仿linux環境編譯工具)、qtcreator和對應的sdk,下載boost1.5.0(需要依賴庫)、openssl、伯克利db、miniupnp;配置好系統環境變數,qt環境,使用mingw編譯boost庫(這個需要編譯大概2個小時),openssl、伯克利db、miniupnp等文件,編譯命令在ltc源代碼里的mingw-unix文件里有詳細說明。
2.第二步:編譯widows錢包。從github下ltc源代碼。
3.第三步:調整參數,生成屬於你的山寨幣。還是在qtcreator打開各個源文件,找到對應的地方調整參數即可。
H. 新人求教 驅動源碼編譯安裝
1、安裝scons
(1) 下載python2.7, 使用x86_32位,因為scons只有32位安裝包可用;
(2) 下載scons2.3.0;
(3) 安裝python 和 scons, 將C:\Python27\Scripts寫入PATH;
(4) 下載安裝pywin32 ,It is recommended you install pywin32 if you want to do parallel builds (scons -j)
2、安裝boost庫(1.49版本).
解壓後雙擊bootstrap.bat,生成bjam.exe後,cd到目錄c:\boost下,(將boost_1_49更名為boost了)編譯boost。
編譯命令:C:\boost>bjam variant=release --with-filesystem --with-thread --with-date_time --with-program_options threading=multi toolset=msvc-10.0 link=static runtime-link=static address-model=32
這是使用VS2010環境編譯的release版本,編譯完成後,生成C:\boost\stage\lib文件夾,下面有6個lib庫:
如果要編譯成debug版本,使用命令:bjam variant=debug --with-filesystem --with-thread --with-date_time --with-program_options threading=multi toolset=msvc-10.0 link=static runtime-link=static address-model=32
編譯完成後,生成C:\boost\stage\lib文件夾,下面有10個lib庫和dll:
此處為MongoDB文檔中對於編譯boost庫的要求原文:
When using bjam, MongoDB expects
variant=debug for debug builds, and variant=release for release builds
threading=multi
link=static runtime-link=static for release builds
address-model=64 for 64 bit(64位的話,把32換為64)。link=static runtime-link=static,boost需要編譯成靜態庫,因為mongodb只會去鏈接boost的靜態庫
address-model=64在win7 64環境下此項必須,不加在編譯mongodb的c++ client時會出現鏈接錯誤。
3、下載mongo2.4.6源碼 http://www.mongodb.org/downloads官網下載
編譯Mongoclient.lib
cmd命令提示符下,cd到解壓後的文件目錄,例如我放在了E盤,E:\mongodb-src-r2.4.6,輸入命令:
scons –-dd --32 mongoclient.lib // build C++ client driver library
Add --64 or --32 to get the 64- and 32-bit versions, respectively. Replace --release with --dd to build a debug build.
編譯後在mongodb\build\win32\32\dd\client_build\生成mongoclient.lib.
4、測試程序
就用Mongodb自帶的例子吧,使用VS2010打開E:\mongodb-src-r2.4.6\src\mongo\client\examples中的simple_client_demo.vcxproj,編譯,會提示生成simple_client_demo.sln,保存。
使用debug模式,配置工程環境:打開工程->屬性,配置Configuration Properties下的VC++ Directories,頭文件路徑添加C:\boost,Lib庫路徑添加boost的lib,以及mongodb client的lib:
C:\boost\stage\lib
E:\mongodb-src-r2.4.6\build\win32\32\dd\client_build
進入C/C++下面的Code Generation,將Runtime Library設置為Multi-threaded Debug (/MTd)
進入Linker下面的Input,設置Additional Dependencies,添加ws2_32.lib,psapi.lib,Dbghelp.lib,mongoclient.lib
將E:\mongodb-src-r2.4.6\build\win32\32\dd\mongo\base下生成的error_codes.h和error_codes.cpp文件,拷貝到E:\mongodb-src-r2.4.6\src\mongo\base目錄下。
ok,編譯、運行.
5、問題解決
error LNK2038: mismatch detected for '_MSC_VER': value '1700' doesn't match value '1600' in error_codes.obj
1>mongoclient_d.lib(dbclient.obj) : error LNK2038: mismatch detected for '_MSC_VER': value '1700' doesn't match value '1600' in error_codes.obj
1>mongoclient_d.lib(assert_util.obj) : error LNK2038: mismatch detected for '_MSC_VER': value '1700' doesn't match value '1600' in error_codes.obj
1>mongoclient_d.lib(jsobj.obj) : error LNK2038: mismatch detected for '_MSC_VER': value '1700' doesn't match value '1600' in error_codes.obj
1>mongoclient_d.lib(status.obj) : error LNK2038: mismatch detected for '_MSC_VER': value '1700' doesn't match value '1600' in error_codes.obj
1>mongoclient_d.lib(mutexdebugger.obj) : error LNK2038: mismatch detected for '_MSC_VER': value '1700' doesn't match value '1600' in error_codes.obj
VS的版本不匹配,lib是在更高級的版本中編譯生成的,而使用的時候,是在低級版本中使用的,所以出現了不匹配的錯誤。例如,我在VS2010 SP1和VS2012的環境下編譯的,而使用是在VS2010上使用,所以在編譯時,出現了以上問題。
1>mongoclient.lib(stacktrace.obj) : error LNK2001: unresolved external symbol __imp_SymCleanup
1>mongoclient.lib(stacktrace.obj) : error LNK2001: unresolved external symbol __imp_SymGetMoleInfo64
1>mongoclient.lib(stacktrace.obj) : error LNK2001: unresolved external symbol __imp_SymInitialize
1>mongoclient.lib(stacktrace.obj) : error LNK2001: unresolved external symbol __imp_StackWalk64
1>mongoclient.lib(stacktrace.obj) : error LNK2001: unresolved external symbol __imp_SymFromAddr
在工程依賴庫中添加Dbghelp.lib
其它問題,看看你手頭的編譯器、編譯出來的boost庫版本、mongoclient.lib的版本,是否對應好了。
I. RPM和boost是什麼意思
RPM是RedHat Package Manager(RedHat軟體包管理工具)類似Windows裡面的「添加/刪除程序」
rpm 執行安裝包
二進制包(Binary)以及源代碼包(Source)兩種。二進制包可以直接安裝在計算機中,而源代碼包將會由RPM自動編譯、安裝。源代碼包經常以src.rpm作為後綴名。
Boost庫是一個經過千錘百煉、可移植、提供源代碼的C++庫,,作為標准庫的後備,是C++標准化進程的發動機之一。 Boost庫由C++標准委員會庫工作組成員發起,其中有些內容有望成為下一代C++標准庫內容。在C++社區中影響甚大,其成員已近2000人。 Boost庫為我們帶來了最新、最酷、最實用的技術,是不折不扣的「准」標准庫。可從 sourceforge.net/...d=7586下載安裝boost庫。大部分boost庫功能的使用只需包括相應頭文件即可,少數(如正則表達式庫,文件系統庫等)需要鏈接庫。裡面有許多具有工業強度的庫,如graph庫。Boost中比較有名氣的有這么幾個庫:Regex正則表達式庫SpiritLL parser framework,用C++代碼直接表達EBNFGraph圖組件和演算法Lambda在調用的地方定義短小匿名的函數對象,很實用的functional功能concept check檢查泛型編程中的conceptMpl用模板實現的元編程框架Thread可移植的C++多線程庫Python把C++類和函數映射到Python之中Pool內存池管理smart_ptr5個智能指針,學習智能指針必讀,一份不錯的參考是來自CUJ的文章:Smart Pointers in Boost,哦,這篇文章可以查到,CUJ是提供在線瀏覽的。中文版見筆者在《Dr.Dobb's Journal軟體研發雜志》第7輯上的譯文。Boost總體來說是實用價值很高,質量很高的庫。並且由於其對跨平台的強調,對標准C++的強調,是編寫平台無關,現代C++的開發者必備的工具。但是Boost中也有很多是實驗性質的東西,在實際的開發中實用需要謹慎。
J. boost最新版1.48.我想分析下裡面的asio的源代碼,該如何做,我在windows下,應該用什麼編譯器
微軟的C++編譯器即可.