亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

VS2019配置BOOST的方法(v1.70.0庫(kù))

 更新時(shí)間:2020年08月05日 09:57:14   作者:RiskAI  
這篇文章主要介紹了VS2019配置BOOST的方法(v1.70.0庫(kù)),文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧

安裝編譯Boost c++ library

安裝Boost庫(kù)

官網(wǎng)下載:https://www.boost.org/users/history/version_1_70_0.html

最新版本1.70.0. (低于1.7.0的版本可能在vs2019中支持不完善,編譯或運(yùn)行時(shí)發(fā)生不可預(yù)料的bug)

下載好后,解壓,得到文件目錄如下圖,找到其中的bootstrap.bat文件:


雙擊運(yùn)行可能出現(xiàn)閃退,最好的辦法(親測(cè)有效): 選擇vs2019 —> visual studio tools —> vc —> x86_x64 Cross Tools Command Prompt for VS 2,打開(kāi)命令行:



切換到boost_1_70_0的安裝目錄,(本人安裝路徑:E:\program\boost_1_70_0)

cd E:\program\boost_1_70_0
bootstrap.bat # 執(zhí)行

執(zhí)行會(huì)發(fā)現(xiàn)當(dāng)前文件夾中增加了幾個(gè)文件,找到其中的bjam.exe,如下圖所示


命令行執(zhí)行:

bjam.exe --toolset=msvc-14.1 architecture=x86 address-model=64 link=static --build-type=complete --with-system --with-thread --with-date_time --with-filesystem --with-serialization

Note:

MSVC 版本號(hào)對(duì)應(yīng)

1.MSVC++ 14.0 _MSC_VER == 1900 (Visual Studio 2015)
2.MSVC++ 12.0 _MSC_VER == 1800 (Visual Studio 2013)
3.MSVC++ 11.0 _MSC_VER == 1700 (Visual Studio 2012)
4.MSVC++ 10.0 _MSC_VER == 1600 (Visual Studio 2010)
5.MSVC++ 9.0  _MSC_VER == 1500 (Visual Studio 2008)
6.MSVC++ 8.0  _MSC_VER == 1400 (Visual Studio 2005)
7.MSVC++ 7.1  _MSC_VER == 1310 (Visual Studio 2003)
8.MSVC++ 7.0  _MSC_VER == 1300
9.MSVC++ 6.0  _MSC_VER == 1200
10.MSVC++ 5.0  _MSC_VER == 1100

vs2019 可以支持boost c++ library 針對(duì)msvc-14.1的編譯選項(xiàng)

等待5-10min即可完成。

最后兩個(gè)路徑會(huì)在使用Boost庫(kù)時(shí)工程屬性中包含目錄和庫(kù)目錄中用到。

The Boost C++ Libraries were successfully built.
the following directory should be added to compiler include paths:
E:\program\boost_1_70_0
the following directory should be added to linker library paths:
E:\program\boost_1_70_0\stage\lib

這時(shí)boost庫(kù)已經(jīng)安裝、編譯成功。

新建vs2019 c++項(xiàng)目,并添加boost依賴(lài)庫(kù)

點(diǎn)擊菜單欄 項(xiàng)目——>屬性——>選擇VC++目錄,在包含目錄 和 庫(kù)目錄添加以上2個(gè)路徑,如下圖:


或可以新建一個(gè)系統(tǒng)環(huán)境變量BOOST_DIR,值為E:\program\boost_1_70_0。

在path系統(tǒng)環(huán)境變量中添加:%BOOST_DIR%;

VC++包含目錄中添加: %BOOST_DIR%;

VC++庫(kù)目錄中添加: %BOOST_DIR%\stage\lib;

代碼測(cè)試

#include <boost/lexical_cast.hpp>   
#include <iostream>  

using namespace std;
using namespace boost;

int main()
{
	//system("chcp 65001");

	double a = lexical_cast<double>("3.1415926");
	string str = lexical_cast<string>("3.1415926");
	cout << "This is a number: " << a << endl;
	cout << "This is a string: " << str << endl;
	int b = 0;
	try {
		b = lexical_cast<int>("neo");
	}
	catch (bad_lexical_cast& e) {
		cout << e.what() << endl;
	}
	return 0;
}

運(yùn)行輸出(正常):

This is a number: 3.14159
This is a string: 3.1415926
bad lexical cast: source type value could not be interpreted as target

c++ boost庫(kù)說(shuō)明

c++ boost庫(kù)官網(wǎng)

官網(wǎng)最新版文檔說(shuō)明:https://www.boost.org/doc/libs/1_70_0/

refer: 百度百科

Boost庫(kù)是一個(gè)可移植、提供源代碼的C++庫(kù),作為標(biāo)準(zhǔn)庫(kù)的后備,是C++標(biāo)準(zhǔn)化進(jìn)程的開(kāi)發(fā)引擎之一,是為C++語(yǔ)言標(biāo)準(zhǔn)庫(kù)提供擴(kuò)展的一些C++程序庫(kù)的總稱(chēng)。 Boost庫(kù)由C++標(biāo)準(zhǔn)委員會(huì)庫(kù)工作組成員發(fā)起,其中有些內(nèi)容有望成為下一代C++標(biāo)準(zhǔn)庫(kù)內(nèi)容。在C++社區(qū)中影響甚大,是不折不扣的“準(zhǔn)”標(biāo)準(zhǔn)庫(kù)。Boost由于其對(duì)跨平臺(tái)的強(qiáng)調(diào),對(duì)標(biāo)準(zhǔn)C++的強(qiáng)調(diào),與編寫(xiě)平臺(tái)無(wú)關(guān)。大部分boost庫(kù)功能的使用只需包括相應(yīng)頭文件即可,少數(shù)(如正則表達(dá)式庫(kù),文件系統(tǒng)庫(kù)等)需要鏈接庫(kù)。但Boost中也有很多是實(shí)驗(yàn)性質(zhì)的東西,在實(shí)際的開(kāi)發(fā)中使用需要謹(jǐn)慎。

Boost庫(kù)由Boost社區(qū)組織開(kāi)發(fā)、維護(hù)。其目的是為C++程序員提供免費(fèi)、同行審查的、可移植的程序庫(kù)。Boost庫(kù)可以與C++標(biāo)準(zhǔn)庫(kù)完美共同工作,并且為其提供擴(kuò)展功能。Boost庫(kù)使用Boost License來(lái)授權(quán)使用。

Boost社區(qū)建立的初衷之一就是為C++的標(biāo)準(zhǔn)化工作提供可供參考的實(shí)現(xiàn),Boost社區(qū)的發(fā)起人Dawes本人就是C++標(biāo)準(zhǔn)委員會(huì)的成員之一。在Boost庫(kù)的開(kāi)發(fā)中,Boost社區(qū)也在這個(gè)方向上取得了豐碩的成果。在送審的C++標(biāo)準(zhǔn)庫(kù)TR1中,有十個(gè)Boost庫(kù)成為標(biāo)準(zhǔn)庫(kù)的候選方案。在更新的TR2中,有更多的Boost庫(kù)被加入到其中。從某種意義上來(lái)講,Boost庫(kù)成為具有實(shí)踐意義的準(zhǔn)標(biāo)準(zhǔn)庫(kù)。
可下載Boost C++ Libraries安裝boost庫(kù)。大部分boost庫(kù)功能的使用只需包括相應(yīng)頭文件即可,少數(shù)(如正則表達(dá)式庫(kù),文件系統(tǒng)庫(kù)等)需要鏈接庫(kù)。里面有許多具有工業(yè)強(qiáng)度的庫(kù),如graph庫(kù)。

主要分類(lèi)

按照功能分類(lèi)的Boost庫(kù)列表
按照實(shí)現(xiàn)的功能,Boost 可為大致歸入以下20個(gè)分類(lèi),在下面的分類(lèi)中,有些庫(kù)同時(shí)歸入幾種類(lèi)別。
字符串和文本處理
a) Conversion
b) Format
c) IOStream
d) Lexical Cast
e) Regex
f) Spirit
g) String Algo
h) Tokenizer
i) Wave
j) Xpressive

容器
a) Array
b) Bimap
c) Circular Buffer
d) Disjoint Sets
e) Dynamic Bitset
f) GIL
g) Graph
h) ICL
i) Intrusive
j) Multi-Array
k) Multi-Index
l) Pointer Container
m) Property Map
n) Property Tree
o) Unordered
p) Variant

迭代器
a) GIL
b) Graph
c) Iterators
d) Operators
e) Tokenizer

算法
a) Foreach
b) GIL
c) Graph
d) Min-Max
e) Range
f) String Algo
g) Utility

函數(shù)對(duì)象和高階編程
a) Bind
b) Function
c) Functional
d) Functional/Factory
e) Functional/Forward
f) Functional/Hash
g) Lambda
h) Member Function
i) Ref
j) Result Of
k) Signals
l) Signals2
m) Utility

泛型編程
a) Call Traits
b) Concept Check
c) Enable If
d) Function Types
e) GIL
f) In Place Factory, Typed In Place Factory
g) Operators
h) Property Map
i) Static Assert
j) Type Traits

模板元編程

a) Function Types
b) Fusion
c) MPL
d) Proto
e) Static Assert
f) Type Traits

預(yù)處理元編程
a) Preprocessors

并發(fā)編程

a) Asio
b) Interprocess
c) MPI
d) Thread

數(shù)學(xué)和數(shù)字

a) Accumulators
b) Integer
c) Interval
d) Math
e) Math Common Factor
f) Math Octonion
g) Math Quaternion
h) Math/Special Functions
i) Math/Statistical Distributions
j) Multi-Array
k) Numeric Conversion
l) Operators
m) Random
n) Rational
o) uBLAS

排錯(cuò)和測(cè)試

a) Concept Check
b) Static Assert
c) Test

數(shù)據(jù)結(jié)構(gòu)

a) Any
b) Bitmap
c) Compressed Pair
d) Fusion
e) ICL
f) Multi-Index
g) Pointer Container
h) Property Tree
i) Tuple
j) Uuid
k) Variant

圖像處理

a) GIL

輸入輸出

a) Asio
b) Assign
c) Format
d) IO State Savers
e) IOStreams
f) Program Options
g) Serialization

跨語(yǔ)言混合編程

a) Python

內(nèi)存管理

a) Pool
b) Smart Ptr
c) Utility

解析
a) Spirit

編程接口
a) Function
b) Parameter

雜項(xiàng)
a) Compressed Pair
b) Conversion
c) CRC
d) Date Time
e) Exception
f) Filesystem
g) Flyweight
h) Lexical Cast
i) Meta State Machine
j) Numeric Conversion
k) Optional
l) Polygon
m) Program Options
n) Scope Exit
o) Statechart
p) Swap
q) System
r) Timer
s) Tribool
t) Typeof
u) Units
v) Utility
w) Value Initialized

編譯器問(wèn)題的變通方案

a) Compatibility
b) Config

常用庫(kù)

  • Regex
  • 正則表達(dá)式庫(kù)
  • Spirit
  • LL parser framework,用C++代碼直接表達(dá)EBNF
  • Graph
  • 圖組件和算法
  • Lambda
  • 在調(diào)用的地方定義短小匿名的函數(shù)對(duì)象,很實(shí)用的functional功能
  • concept check
  • 檢查泛型編程中的concept
  • Mpl
  • 用模板實(shí)現(xiàn)的元編程框架
  • Thread
  • 可移植的C++多線程庫(kù)
  • Python
  • 把C++類(lèi)和函數(shù)映射到Python之中
  • Pool
  • 內(nèi)存池管理
  • smart_ptr
  • 5個(gè)智能指針,學(xué)習(xí)智能指針必讀,一份不錯(cuò)的參考是來(lái)自CUJ的文章:

相關(guān)圖書(shū)編輯

  • Boost程序庫(kù)完全開(kāi)發(fā)指南:深入C++“準(zhǔn)”標(biāo)準(zhǔn)庫(kù)
  • C++11/14高級(jí)編程:Boost程序庫(kù)探秘(第3版)
  • Boost程序庫(kù)探秘:深度解析C++準(zhǔn)標(biāo)準(zhǔn)庫(kù)

到此這篇關(guān)于VS2019配置BOOST的方法(v1.70.0庫(kù))的文章就介紹到這了,更多相關(guān)VS2019配置BOOST內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

最新評(píng)論