VS2010 安裝 Boost 庫 1.54
轉自:http://blog.csdn.net/xzz_hust/article/details/9365511
Boost庫被稱為C++準標準庫, 功能很是強大, 下面記錄我在VS2010中安裝使用Boost庫的過程.
首先上官網http://www.boost.org/下載最新的Boost庫, 我的版本是1_54_0版本, 解壓下載的檔案到任一資料夾,
我放D盤boost目錄下. 之後開始-執行-cmd開啟dos視窗, 進入到boost庫根目錄下, 使用如下命令
cd D:\boost\boost_1_54_0
boost庫中有一部分可以不需要編譯就可以使用, 因為其功能直接在標頭檔案使用模板和inline函式實現, 具體哪些
可以檢視文件, 另外一部分則需要編譯成外部庫使用. 編譯方法如下(官方文件中提供的方法):
執行下面兩條命令:
bootstrap .\b2
第一條命令是準備boost編譯環境, 第二條命令是編譯boost庫. 第二條命令則是編譯, 其引數可以檢視這裡Boost.Build documentation.
編譯過程比較慢, 20分鐘以上, 慢慢等待. 編譯之後的boost資料夾大概有2個多G.
在VS2010中使用boost也很簡單, 下面是使用方法:
1、Properties > C/C++ > General > Additional Include Directories這裡設定包含標頭檔案的路徑
例如:D:\boost\boost_1_54_0(到Boost目錄的上一級)
2、Properties > C/C++ > Precompiled Headers,:Not Using Precompiled Headers:禁用標頭檔案
3、Properties > Linker > General > Additional Library Directories新增包含的庫目錄
例如:D:\boost\boost_1_54_0\stage\lib
驗證是否安裝成功請新建工程example, 設定好屬性後編譯下面的程式:
- #include <boost/regex.hpp>
- #include <iostream>
- #include <string>
- int main()
- {
- std::string line;
- boost::regex pat( "^Subject: (Re: |Aw: )*(.*)" );
- while (std::cin)
- {
- std::getline(std::cin, line);
- boost::smatch matches;
- if (boost::regex_match(line, matches, pat))
- std::cout << matches[2] << std::endl;
- }
- }
然後將下面的內容儲存為test.txt測試檔案
- To: George Shmidlap
- From: Rita Marlowe
- Subject: Will Success Spoil Rock Hunter?
- ---
- See subject.
path\to\compiled\example < path\to\test.txt如果輸出如下:
Will Success Spoil Rock Hunter?
則表示安裝成功. Good Luck!
相關文章
- Ubuntu下安裝C++ boost庫UbuntuC++
- Linux安裝boost、libevent、zlib、OpenSSL庫Linux
- vs2010安裝教程_vs2010如何安裝【圖文】
- boost的安裝、檢視與解除安裝(某動態庫要求的boost版本不適配怎麼辦?)
- 安裝VS2010開發環境開發環境
- rocky9中boost的安裝
- Win10系統怎麼安裝VS2010 win10系統安裝VS2010的方法Win10
- AnkhSvn安裝後 VS2010中沒有Subversion
- 最新Turbo Boost Switcher Pro補丁破解版 Turbo Boost Switcher Pro破解安裝教程
- 安裝caffe時候找不到boost怎麼辦?(boost的引用問題make can‘t find Boost‘s include files)
- 在Qt中使用boost庫QT
- Windows下下載編譯boost庫Windows編譯
- boost_python庫pyd執行庫不可少!Python
- 安裝 Dispatch 庫
- Python安裝graphics庫Python
- Eigen庫的安裝
- 使用Boost庫報error C4996錯誤Error996
- BOOST庫 學習參考完全開發指南
- 達夢8資料庫安裝和解除安裝資料庫
- MongoDB資料庫安裝MongoDB資料庫
- python 如何安裝numpy庫?Python
- Redis 資料庫安裝Redis資料庫
- 安裝 Lua 的 HTTP 庫HTTP
- Ubuntu 下安裝Python庫UbuntuPython
- oricle資料庫安裝資料庫
- catboost庫作用與安裝
- GreenPlum資料庫安裝資料庫
- react 19.0.0 倉庫安裝React
- boost library
- boost and windowsWindows
- 深度學習庫安裝list深度學習
- Python3安裝requests庫Python
- Oracle 資料庫打包安裝Oracle資料庫
- anaconda安裝cv2庫
- Ubuntu安裝MySQL資料庫UbuntuMySql資料庫
- python庫批量安裝的方法Python
- conda安裝庫所在路徑
- AD元件庫安裝與使用元件
- tar方式安裝資料庫資料庫