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

本人下载的版本:asio-1.12.2

1,本人环境:

dengzhongqiangdeMacBook-Pro:asio-1.12. dengzhongqiang$ clang -v
Apple LLVM version 10.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. 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 '' is supported by ustar format... yes
checking whether GID '' 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++ is enabled... no
checking whether C++ 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. dengzhongqiang$ make
Making all in include
make[]: Nothing to be done for `all'.
Making all in src
Making all in examples/cpp03
g++ -I./../../../include -g -O2 -ftemplate-depth- -o icmp/ping icmp/ping.o
Undefined symbols for architecture x86_64:
"boost::chrono::steady_clock::now()", referenced from:
pinger::start_send() in ping.o
asio::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.o
asio::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.o
asio::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.o
pinger::handle_receive(unsigned long) in ping.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code (use -v to see invocation)
make[]: *** [icmp/ping] Error
make[]: *** [all-recursive] Error
make: *** [all-recursive] Error

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

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

解决办法:

1.安装boost库

brew install boost

然后执行

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

4.安装asio

make install 

Mac OS 使用asio库的更多相关文章

  1. cmake: error: symbol(s) not found for architecture x86_64 mac os 使用boost asio

    最近在使用boost的asio库,在mac osx 上编写网络服务程序报错: :-1: error: symbol(s) not found for architecture x86_64 然后在CM ...

  2. AppCode 中开发 Mac OS X 应用程序或共享库的经验小结

    AppCode 是 JetBrains 公司出品的用于开发 Mac OS X 及 iOS 应用程序的集成开发环境,只能运行于 Mac OS X 操作系统环境下,作为 XCode 的高级替代品.由于其基 ...

  3. Mac OS X10.10_xcode6.1_ios8.1环境下,编译lame静态库libmp3lame.a,支持arm64 armv7s x86_64 i386 armv7指令集

    近期升级了系统到Mac OS X 10.10 而且更新了XCode6.1和iOS 8.1 之前app用到的libmp3lame.a静态库.也要支持64位的模拟器(x86_64)和64位的真机(arm6 ...

  4. Qt在Mac OS X下的编程环境搭建(配置Qt库和编译器,有图,很清楚)

    尊重作者,支持原创,如需转载,请附上原地址:http://blog.csdn.net/libaineu2004/article/details/46234079 在Mac OS X下使用Qt开发,需要 ...

  5. Mac os 下 python爬虫相关的库和软件的安装

      由于最近正在放暑假,所以就自己开始学习python中有关爬虫的技术,因为发现其中需要安装许多库与软件所以就在这里记录一下以避免大家在安装时遇到一些不必要的坑. 一. 相关软件的安装:   1. h ...

  6. 记录Mac OS下编译Thrift库

    方法一:brew管理工具安装Homebrew是Mac开发包管理工具,类似于Linux的apt-get之类的,实它相当于开发软件界的 Appstore.借助该管理工具,可以自动化地安装软件包,它会自动安 ...

  7. ROS2 MAC OS Install

    ROS2 MAC OS Install(非原创),安装过程记录一下 注意: (1)如果安装了anaconda,请将~/.bash_profile文件中的export PATH="/anaco ...

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

    在Mac OS X中配置Apache + PHP + MySQL Mac OS X 内置Apache 和 PHP,使用起来非常方便.本文以Mac OS X 10.6.3和为例.主要内容包括: 启动Ap ...

  9. Mac OS X 上安装 ASP.NET 5

    在Mac OS X Yosemite 10.10.3 中搭建第一个 ASP.NET 5 Web 项目 终于有时间在 Mac 上安装一下 ASP.NET 5,网上有许多教程,但是多数的时间比较早了,版本 ...

随机推荐

  1. Serializable and XmlEnum

    The easiest way is to use [XmlEnum] attribute like so: [Serializable] public enum EnumToSerialize { ...

  2. IIS application pool access desktop denied

    https://stackoverflow.com/questions/5437723/iis-apppoolidentity-and-file-system-write-access-permiss ...

  3. 并不对劲的bzoj4651:loj2084:uoj220:p1173:[NOI2016]网格

    题目大意 有一个\(n*m\)(\(n,m\leq10^9\))的网格,每个格子是空地或障碍(\(障碍数\leq10^5\)) 定义两块空地连通,当且仅当它们是"相邻的两块空地"或 ...

  4. 说说Java观察者模式

    观察者模式是对象行为模式中的一种,在平时项目中经常被用来解耦对象之间的依赖. 观察者模式定义了对象间的一种一对多的依赖关系,当一个对象的状态发生改变时,所有依赖它的对象都得到通知并自动更新.别名:De ...

  5. 【转】Android 6.0 Marsmallow BLE : Connection Parameters

    原文网址:http://stackoverflow.com/questions/34617061/android-6-0-marsmallow-ble-connection-parameters Th ...

  6. bzoj3631 [JLOI2014]松鼠的新家——树上差分

    题目:https://www.lydsy.com/JudgeOnline/problem.php?id=3631 树上差分:注意路径的结尾被多算了一次,最后要减去(不能提前减). 代码如下: #inc ...

  7. Win7下安装MongoDB4.0.10

    前言 MySQL与MongoDB都是开源的常用数据库,但是MySQL是传统的关系型数据库,MongoDB则是非关系型数据库,也叫文档型数据库,是一种NoSQL的数据库.它们各有各的优点,关键是看用在什 ...

  8. (矩阵快速幂)51NOD 1242斐波那契数列的第N项

    斐波那契数列的定义如下:   F(0) = 0 F(1) = 1 F(n) = F(n - 1) + F(n - 2) (n >= 2)   (1, 1, 2, 3, 5, 8, 13, 21, ...

  9. [Swift]编程语言:文档修订历史

    ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★➤微信公众号:山青咏芝(shanqingyongzhi)➤博客园地址:山青咏芝(https://www.cnblogs. ...

  10. jsp标准标签库——jstl

    JSP标准标签库(JSTL)是一个JSP标签集合,它封装了JSP应用的通用核心功能. JSTL支持通用的.结构化的任务,比如迭代,条件判断,XML文档操作,国际化标签,SQL标签. 除了这些,它还提供 ...