当前位置:网站首页>Cpp(四) Boost安装及基本使用 for Mac
Cpp(四) Boost安装及基本使用 for Mac
2020-11-07 20:58:00 【Coxhuang】
文章目录
Boost安装及使用 for Mac
#1 环境
CMake 3.17 C++14 macOS 10.15.5 Clion
#2 开始
Boost在Mac上安装及使用(Clion)
#2.1 下载Boost
地址: https://www.boost.org/users/history/version_1_58_0.html
因为平时使用ROS的原因,所以使用58版本的Boost
#2.2 安装Boost
- 解压
- 进入解压后的文件
cd boost_1_58_0
3. 执行
./bootstrap.sh sudo ./b2 install
一两分钟分钟之后编译安装完成
- 头文件 :
/usr/local/include/boost - 库文件 :
/usr/local/lib
#3 使用
这里使用
Clion编辑器
- 使用Clion创建一个简单的工程
- 修改CMakeList.txt
cmake_minimum_required(VERSION 3.17)
project(6_boost_demo)
set(CMAKE_CXX_STANDARD 14)
set(BOOST_ROOT "/usr/local/include/boost")
include_directories(/usr/local/include) # 添加头文件搜索路径
link_directories(/usr/local/lib) # 添加库文件搜索路径
aux_source_directory(. DIR_SRCS)
add_executable(6_boost_demo ${DIR_SRCS})
3. main.cpp
#include <iostream>
#include <boost/version.hpp>
int main() {
std::cout << "Hello, World" << std::endl;
std::cout << "Boost版本:" << BOOST_VERSION << std::endl;
return 0;
}
本文参与腾讯云自媒体分享计划,欢迎正在阅读的你也加入,一起分享。
版权声明
本文为[Coxhuang]所创,转载请带上原文链接,感谢
https://cloud.tencent.com/developer/article/1744569
边栏推荐
- Technical debt is a lack of real understanding of business functions- daverupert.com
- When tidb and Flink are combined: efficient and easy to use real-time data warehouse
- C语言I博客作业03
- How Facebook open source framework simplifies pytorch experiment
- Kylin on kubernetes' practice on eBay
- MongoDB下,启动服务时,出现“服务没有响应控制功能”解决方法
- Vscode configuration
- There's not much time left for Kwai Chung.
- 高级并发编程系列九(Lock接口分析)
- 是时候结束 BERTology了
猜你喜欢

Got timeout reading communication packets解决方法

洞察——风格注意力网络(SANet)在任意风格迁移中的应用

Do not understand the underlying principle of database index? That's because you don't have a B tree in your heart

Vscode configuration

A detailed explanation of microservice architecture

laravel8更新之维护模式改进

From technology to management, the technology of system optimization is applied to enterprise management

一文详解微服务架构

Git代码提交操作,以及git push提示failed to push some refs'XXX'

盘点那些争议最大的编程观点,你是什么看法呢?
随机推荐
Adobe Prelude /Pl 2020软件安装包(附安装教程)
DOM节点操作
你可能不知道的Animation动画技巧与细节
聊聊Go代码覆盖率技术与最佳实践
Don't treat exceptions as business logic, which you can't afford
awk实现类sql的join操作
汇编函数mcall systemstack asmcgocall syscall
Big data algorithm - bloon filter
It's time to end bertology
快速上手Git
Summary of the resumption of a 618 promotion project
工作1-3年的程序员,应该具备怎么样的技术能力?该如何提升?
What should be considered in the promotion plan outside the station?
The samesite problem of cross domain cookie of Chrome browser results in abnormal access to iframe embedded pages
Win10官方1909版本无法打开windows安全中心中病毒和威胁防护的实时保护解决方案。
Count the frequency of letters in text (case insensitive)
看一遍就理解,图解单链表反转
[original] the influence of arm platform memory and cache on the real-time performance of xenomai
C语言Ⅰ博客作业03
awk实现类sql的join操作