boost / vs2017 编译 boost 1.68.0 的过程说明
一、準備
下載 boost 1.68.0 源代碼,點我。
二、選擇命令行工具
強調:編譯時使用 vs2017 開發者命令行工具,
若編譯生成 x86 的庫,就使用 x86?Native Tools Command Prompt for VS 2017 命令行工具;
若編譯生成 x64 的庫,就使用 x64 Native Tools Command Prompt for VS 2017?命令行工具。
三、指令
1、bootstrap.bat
生成 b2.exe,bjam.exe 和 project-config.jam 。
2、b2.exe? ?install? ?--toolset=msvc-14.1???--prefix="D:\boost_1_68_0\bin\v141"? ?threading=multi? ?--build-type=complete? ?--build-dir="D:\boost_1_68_0\build"? ?address-model=64
(1)stage
可選 install,選 stage 只生成庫(靜態庫和動態庫),install 還包含 include 目錄。
(2)--toolset
設置編譯器,如果用 VC 則寫?msvc,用 MinGW 就寫 gcc 。
應為這里使用的是 vs2017 平臺工具集,所以這里寫法是 msvc-14.1.
拓展:
| VS IDE 版本 | 平臺工具集 | 
| Visual Studio 2019 | v142 | 
| Visual Studio 2017 | v141 | 
| Visual Studio 2015 | v140 | 
| Visual Studio 2013 | v120 | 
| Visual Studio 2012 | V110 | 
| Visual Studio 2010 | V100 | 
| Visual Studio 2008 | V90 | 
| Visual Studio 2005 | V80 | 
| Visual Studio 2003 | V71 | 
| Visual Studio 2002 | V70 | 
| Visual Studio 6.0 | V60 | 
(3)--build-dir=”folder path”
存放編譯時產生的臨時文件路徑。
(4)--prefix=” folder path”
存放編譯后庫文件的路徑,默認是stage。
(5)variant=debug|release? ? ? ?
決定編譯什么版本。(Debug or Release)
(6)link=static|shared? ? ? ? ? ?
決定使用靜態庫還是動態庫。
(7)threading=single|multi? ? ? ?
決定使用單線程還是多線程庫。
(8)runtime-link=static|shared? ?
決定是靜態還是動態鏈接C/C++標準庫。
(10)--build-type=complete
編譯所有版本。
(11)address-model=64
如果沒有這個屬性的話,會默認生成 32 位的平臺庫,加入這個選項才能生成 64 位的DLL。如果運行在 VS32 位的命令行下需要添加”architecture=x86”。
?
參考鏈接:https://jingyan.baidu.com/article/67508eb47cbb479cca1ce4b2.html
?
(SAW:Game Over!)
總結
以上是生活随笔為你收集整理的boost / vs2017 编译 boost 1.68.0 的过程说明的全部內容,希望文章能夠幫你解決所遇到的問題。
 
                            
                        - 上一篇: libwebsockets / vs20
- 下一篇: websocket / 使用 wires
