当前位置:网站首页>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
边栏推荐
- 动态规划——用二进制表示集合的状态压缩DP
- 小熊派开发板实践:智慧路灯沙箱实验之真实设备接入
- 栈-括号的匹配
- 利用线程通信、解决缓存穿透数据库雪崩
- Deep into web workers (1)
- Annual salary of 900000 programmers is not as good as 3800 civil servants a month? How to choose between stability and high income?
- [random talk] the goal and way of software design
- Stack bracket matching
- 屏读时代,我们患上了注意力缺失候群症
- Kylin on kubernetes' practice on eBay
猜你喜欢

什么都2020了,LINQ查询你还在用表达式树

Business facade and business rule

A detailed explanation of microservice architecture

Ac86u KX Online

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

微服务的出现和意义的探索

深入web workers (上)

使用“1”个参数调用“DownloadString”时发生异常:“操作超时”

What kind of technical ability should a programmer who has worked for 1-3 years? How to improve?

Let's talk about the locks in the database
随机推荐
Business Facade 与 Business Rule
[C + + learning notes] how about the simple use of the C + + standard library STD:: thread?
30岁后,你还剩下什么?
C language I blog assignment 03
全网最硬核讲解计算机启动流程
chrome浏览器跨域Cookie的SameSite问题导致访问iframe内嵌页面异常
ngnix集群高并发
It's time to end bertology
What should be considered in the promotion plan outside the station?
浅谈HiZ-buffer
Kylin on Kubernetes 在 eBay 的实践
If you want to forget the WiFi network you used to connect to your Mac, try this!
Annual salary of 900000 programmers is not as good as 3800 civil servants a month? How to choose between stability and high income?
Awk implements SQL like join operation
Got timeout reading communication packets解决方法
计组-总线通信控制之异步串行通信的数据传输
如何以计算机的方式去思考
Implementation of multi GPU distributed training with horovod in Amazon sagemaker pipeline mode
static+代码块+多态+异常
On hiz buffer