当前位置:网站首页>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
边栏推荐
- Adobe media encoder /Me 2021软件安装包(附安装教程)
- Kylin on kubernetes' practice on eBay
- Three steps, one pit, five steps and one thunder, how to lead the technical team under the rapid growth?
- static+代码块+多态+异常
- 小熊派开发板实践:智慧路灯沙箱实验之真实设备接入
- Count the frequency of letters in text (case insensitive)
- How to choose a good company
- laravel8更新之维护模式改进
- Exploration and practice of growingio responsive programming
- Facebook开源框架如何简化 PyTorch 实验
猜你喜欢
What kind of technical ability should a programmer who has worked for 1-3 years? How to improve?
laravel8更新之维护模式改进
Reflection on a case of bus card being stolen and swiped
android基础-RadioButton(单选按钮)
看一遍就理解,图解单链表反转
Vscode configuration
【C++学习笔记】C++ 标准库 std::thread 的简单使用,一文搞定还不简单?
A detailed explanation of microservice architecture
聊聊Go代码覆盖率技术与最佳实践
How to learn technology efficiently
随机推荐
What kind of technical ability should a programmer who has worked for 1-3 years? How to improve?
工作1-3年的程序员,应该具备怎么样的技术能力?该如何提升?
On the coverage technology and best practice of go code
Count the frequency of letters in text (case insensitive)
Get started, GIT
Kubernetes服务类型浅析:从概念到实践
使用 Xunit.DependencyInjection 改造测试项目
The official 1909 version of win10 cannot open the real-time protection solution of virus and threat protection in windows security center.
Web安全(一)---浏览器同源策略
WPF 关于绘图个人总结
一万四千字分布式事务原理解析,全部掌握你还怕面试被问?
laravel8更新之维护模式改进
How to think in the way of computer
Git code submission operation, and git push prompt failed to push some refs'xxx '
爆一个VS2015 Update1更新带来的编译BUG【已有解决方案】
Web安全(三)---CSRF攻击
graph generation model
技术债务是对业务功能缺乏真正的理解 -daverupert.com
来自不同行业领域的50多个对象检测数据集
大数据算法——布隆过滤器