下载地址:http://sourceforge.net/projects/asio/files/asio/1.12.2%20%28Stable%29/

本人下载的版本:asio-1.12.2

1,本人环境:

dengzhongqiangdeMacBook-Pro:asio-1.12.2 dengzhongqiang$ clang -v
Apple LLVM version 10.0.0 (clang-1000.10.44.4)
Target: x86_64-apple-darwin18.5.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

2. cd到下载的库目录

dengzhongqiangdeMacBook-Pro:asio-1.12.2 dengzhongqiang$ ./configure
checking whether to enable maintainer-specific portions of Makefiles... no
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether UID '501' is supported by ustar format... yes
checking whether GID '20' is supported by ustar format... yes
checking how to create a ustar tar archive... gnutar
checking build system type... x86_64-apple-darwin18.5.0
checking host system type... x86_64-apple-darwin18.5.0
checking whether make supports the include directive... yes (GNU style)
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking for ranlib... ranlib
checking how to run the C++ preprocessor... g++ -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking boost/noncopyable.hpp usability... yes
checking boost/noncopyable.hpp presence... yes
checking for boost/noncopyable.hpp... yes
checking openssl/ssl.h usability... no
checking openssl/ssl.h presence... no
checking for openssl/ssl.h... no
checking whether C++11 is enabled... no
checking whether C++14 is enabled... no
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating include/Makefile
config.status: creating src/Makefile
config.status: creating src/tests/Makefile
config.status: creating src/examples/cpp03/Makefile
config.status: creating src/examples/cpp11/Makefile
config.status: creating src/examples/cpp14/Makefile
config.status: creating src/examples/cpp17/Makefile
config.status: executing depfiles commands

3.执行make

dengzhongqiangdeMacBook-Pro:asio-1.12.2 dengzhongqiang$ make
Making all in include
make[1]: Nothing to be done for `all'.
Making all in src
Making all in examples/cpp03
g++ -I./../../../include -g -O2 -ftemplate-depth-256   -o icmp/ping icmp/ping.o
Undefined symbols for architecture x86_64:"boost::chrono::steady_clock::now()", referenced from:pinger::start_send() in ping.oasio::detail::timer_queue<asio::detail::chrono_time_traits<boost::chrono::steady_clock, asio::wait_traits<boost::chrono::steady_clock> > >::wait_duration_msec(long) const in ping.oasio::detail::timer_queue<asio::detail::chrono_time_traits<boost::chrono::steady_clock, asio::wait_traits<boost::chrono::steady_clock> > >::wait_duration_usec(long) const in ping.oasio::detail::timer_queue<asio::detail::chrono_time_traits<boost::chrono::steady_clock, asio::wait_traits<boost::chrono::steady_clock> > >::get_ready_timers(asio::detail::op_queue<asio::detail::scheduler_operation>&) in ping.opinger::handle_receive(unsigned long) in ping.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [icmp/ping] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1

这里执行报错了。因为这个报错: boost::chrono::steady_clock::now()

分析:由于本人没有安装 boost,所以就没有这个api了。

解决办法:

1.安装boost库

brew install boost

然后执行

./configure --with-boost='/usr/local/include'

4.安装asio

make install 

转载于:https://www.cnblogs.com/dzqdzq/p/10710357.html

Mac OS 使用asio库相关推荐

  1. MAC OS X 问题库

    MAC问题库 Mac是非常可靠稳定的电脑,但这并不意味着它们就不会犯傻,没有电脑是永远不会出问题的. 下面是常见问题的解决方法,包括Mac,iPhone和iPod. 1:不启动 拔下电源线,如果是笔记 ...

  2. Mac OS编译C++库(XCode)

    一  编译静态库 1.新建xcode项目,选择系统选择ios,工程选择static library. 2.项目名,作者自定,语言选择Object-C 3.保存目录自定. 4.将自动生成的两个.h  . ...

  3. QtXlsx第三方库在Mac OS和Windows下的配置及简单使用

    这里是小白一只,为了参与项目,最近自学了一点qt.要求先做一个实现excel导出的小demo,由于还没看到这部分知识的内容,在书里反复查找也没找到确切的内容,所以开始在网上看了很多博客. 了解到 QA ...

  4. Mac Os 基本命令行

    1.Mac Os 文本系统 unix系统 /  根目录(Root Directory) 根目录只有一个,代表整个硬盘 命令行中执行以下命令: 1.pwd (print work directory) ...

  5. 在 Mac OS X 上安装 TensorFlow

    在 Mac OS X 上安装 TensorFlow 这个文档说明了如何在 Mac OS X 上安装 TensorFlow. 注意:从 1.2 版本开始,在 Mac OS X 上 TensorFlow ...

  6. linux lua ide,mac os上开发lua用什么ide

    2016-09-22 回答 一.mac os x中make和gcc命令的安装 在编译lua前需要做的准备工作. 我将lua-5.2.2.tar.gz下载到苹果电脑中,解压后进行编译时,发现我的mac ...

  7. 在Mac OS X中配置Apache + PHP + MySQL

    内容如下: 1. 启动Apache 2. 设置虚拟主机 3. 运行PHP  4. 安装MySQL  5. 使用phpMyAdmin  6. 配置PHP的MCrypt扩展库 7. GD库安装 8. 增加 ...

  8. Mac OS X上的lipo命令详解

    2019独角兽企业重金招聘Python工程师标准>>> lipo –create Release-iphoneos/libiphone.a Debig-iphonesimulator ...

  9. (转)安装黑苹果 MAC OS X Lion 10.7.2过程 (未验证)

    1.硬件和软件 若要成功组织出一台黑苹果,最重要的是所购的pc机需要兼容mac osx 系统.其中首推主板,cpu,显卡,声卡,网卡. 我的组装机硬件清单: CPU:Intel I5 2500K, 3 ...

  10. Mac OS X 中的脚本语言应用

    http://www.applesupport.com.cn/newshow.asp?id=2442&cid=7 如你所见,Mac OS X 是一套广受程序员喜爱的操作系统,他们之所以如此喜欢 ...

最新文章

  1. 根据二叉树写遍历序列
  2. 如何调整金格电子章服务器印章_如何利用OA系统进行电子公章、红头文件及打印的管理...
  3. 【spring boot】启动类启动 错误: 找不到或无法加载主类 com.codingapi.tm.TxManagerApplication 的解决方案
  4. leetcode 1164 python
  5. 为什么大公司都不用mfc和qt_百度竞价推广效果下降,为什么有的老板还是只愿意做百度推广?...
  6. python 菜品识别_利用百度智能云结合Python体验图像识别(来自qylruirui)
  7. 错误 执行Transact-SQL语句批处理时发生了异常。无法设置主体'sa'的凭据
  8. matlab boundaries和fchcode函数无法执行的解决办法 未定义与 'double' 类型的输入参数相对应的函数 'boundaries'
  9. mysql5.7.22.zip使用,mysql5.7.22 zip 版安装
  10. gb28181协议java_gb28181开发源码
  11. as常用固定搭配_语法必看:as的几种固定用法
  12. 项目-2.EVP论文与代码解析(Audio-Driven Emotional Video Portraits)
  13. 决策树的特性及优缺点
  14. 【python脚本系列】Midi数字化乐器接口
  15. 联想小新一键恢复小孔_联想一键恢复系统怎么用?小新Air 13 Pro怎么还原操作系统?...
  16. 25行代码爬取英雄联盟手游英雄皮肤图片
  17. 计算机平面设计与工程论文,浅谈计算机平面设计和设计软件相互结合
  18. RYU实战,REST API流表控制(2)
  19. ceph更换硬盘操作步骤
  20. 记一次机器内存过高引起的线上故障

热门文章

  1. Bootstrap辅助类之文本情景类
  2. 前端工程师的摸鱼日常(9)
  3. AdventureWorks DW事例数据库下载
  4. 网速魔法师 v1.8 官方安装版
  5. 用串口控制SIM900A打电话和发短信,遇到的一些问题总结。
  6. 山西大学量子计算机,关于量子力学与量子计算机
  7. 计算机xp怎么调整亮度,[如何调整计算机屏幕的亮度] xp系统如何调整屏幕的亮度?屏幕亮度调整方法的详细说明...
  8. Point to Raster 工作原理
  9. 整站下载工具webHttracker webside copier
  10. 信息系统项目10大管理-4W1H