Windows 10 Visual Studio 2017 安裝配置 Boost


1 下載 Boost 源代碼

  1. 根據 Visual Studio 版本來選擇 Boost 版本。在 Visual Studio 中點擊幫助>關於Microsoft Visual Studio 查看版本。VS2017是15.2。
  2. 決定是使用 32-bit 還是 64-bit 的 Boost 庫。
  3. 下載網址下載對應的版本。msvc-15.2 對應的版本還沒有發布,我使用的是 boost_1_64_0-msvc-14.1-64.exe 這個版本。
  4. 下載完成后進行安裝,注意** {Boost 安裝目錄} **

2 編譯 Boost 源代碼

  1. 打開 Developer Command Prompt for VS 2017。
  2. 打開 Developer Command Prompt 后,輸入cd {Boost 安裝目錄}
  3. 輸入bootstrap指令,之后輸入b2
  4. b2命令完成后,屏幕會顯示{compiler include paths}{linker library paths}

3 在 Visual Studio 中添加 Boost

  1. 使用 Visual Studio 建立一個 C++ 項目,右鍵項目,點擊屬性
  2. 點擊 C/C++ > 所有選項
  3. 附加包含目錄出添加 {compiler include paths}
  4. 鏈接器 > 附加庫目錄處添加 {linker library paths}
  5. 點擊確定,在項目包含 Boost 庫來測試是否成功,在源文件頂部添加 #include <boost/foreach.hpp>
  6. 如果編譯成功,說明 Boost 安裝成功了!


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM