Posts Boost库的安装与使用
Post
Cancel

Boost库的安装与使用

1. 前言

1
个人最近没太多时间详细学习一遍Boost,只能用到的一些Boost先记录下来。

2. 安装

M1 Macos 的安装

  1. 官网下载 本机下载的为boost_1_76_0版本,具体见官网

  2. 解压

  3. 进入boost文件夹

  4. 配置编译

    1
    2
    3
    
     ./bootstrap.sh --with-libraries=all --with-toolset=clang
     //或者
     ./bootstrap.sh
    
  5. 编译

    ./b2 -j8

  6. 清除文件

    ./b2 clean -j8

配置Clion boost

CMAKE

1
2
3
4
5
6
7
8
9
10
11
12
13
cmake_minimum_required(VERSION 3.21)
project(BoostTest)

set(CMAKE_CXX_STANDARD 11)
add_executable(BoostTest main.cpp)


#添加头文件搜索路径
include_directories( /Users/xiaoyingxiong/install/boost/boost_1_76_0/)


#添加库文件搜索路径
link_directories(/Users/xiaoyingxiong/install/boost/boost_1_76_0/stage/lib/)
This post is licensed under CC BY 4.0 by the author.

Contents

Trending Tags