VS2019配置boost1.74.0


 
這一段是我們以后配置完之后測試的代碼
#include <iostream>
#include<boost/version.hpp>
#include<boost/config.hpp>
int main()
{
    using namespace std;
    cout << BOOST_VERSION << endl;
    cout << BOOST_LIB_VERSION << endl;
    cout << BOOST_PLATFORM << endl;
    cout << BOOST_COMPILER << endl;
    cout << BOOST_STDLIB << endl;
    getchar();
}

/*boost的命令配置
一:
    下載boost壓縮文件,並解壓到指定文件夾,這里使用d:\boost
二:
    管理員模式運行VS的配置控制台程序“Developer Command Prompt for VS 2019"
    運行以下命令:
        d:\
        cd d:\boost\boost_1_74_0
        bootstrap.bat
三:
    運行完以上命令后,會在目錄下添加一個b2.exe
四:
    繼續執行以下命令:
        .\b2.exe --toolset = msvc - 14.2 architecture = x86 address - model = 32 link = static --build - type = complete --with - system --with - thread --with - date_time --with - filesystem --with - serialization
        .\b2.exe --toolset = msvc - 14.2 architecture = x86 address - model = 32 link = static --build - type = complete --with - system --with - thread --with - random --with - filesystem --with - serialization
        .\b2.exe --toolset = msvc - 14.2 architecture = x86 address - model = 32 link = static --build - type = complete --with - system --with - thread --with - regex --with - filesystem --with - serialization
    時間可能會略久一點
五:
    配置VS項目
        1.右鍵項目,點擊屬性
            1)  C/C++ >> 常規 >>   附加包含目錄 :d:\boost\boost_1_74_0
            2)  鏈接器 >> 常規 >> 附加庫目錄  : d:\boost\boost_1_74_0\stage

執行完以上操作就可以在項目中引用boost的頭文件進行開發了
*/


免責聲明!

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



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