下载地址: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. web前端技术社区分享

    web前端技术社区分享 一.国外的前端技术网站:    1. 名称:W3C: 网址:http://www.w3.org/ 理由:前端技术的规范标准几乎都是W3C制定的  2.名称:ECMA 网址:ht ...

  2. CodeForces 722B Verse Pattern (水题)

    题意:统计元音,这里多加一个元音,y. 析:直接统计就好了. 代码如下: #pragma comment(linker, "/STACK:1024000000,1024000000" ...

  3. (图论)51NOD 1298 圆与三角形

    给出圆的圆心和半径,以及三角形的三个顶点,问圆同三角形是否相交.相交输出"Yes",否则输出"No".(三角形的面积大于0).     输入 第1行:一个数T, ...

  4. 【SQL】从待选项中随机选一个

    由于SQL Server没有数组类型,所以在面对“从若干待选项中选一个”这种需求时,往往要采取变通办法,比如弄个‘a|b|c’这样的字符串然后对字符串进行处理:又或者把待选项塞进一个临时表,然后把问题 ...

  5. ubuntu vim设置显示行号

    打开vim的配置文件 /etc/vim/vimrc sudo vim /etc/vim/vimrc 然后找到 #set number ,把注释取消就行了 如果没有,就自己加一行

  6. the "ssl" parameter requires ngx_http_ssl_module in /usr/local/nginx/conf/nginx.conf

    一:开始Nginx的SSL模块 1.1 Nginx如果未开启SSL模块,配置Https时提示错误 原因也很简单,nginx缺少http_ssl_module模块,编译安装的时候带上--with-htt ...

  7. javascript 截取url参数

    var url="http://127.0.0.1:8080/photo/list.jsp?page=2&user=hongchen"; var params_arr = ...

  8. 前缀+排序 HDOJ 4311 Meeting point-1

    题目传送门 题意:给一些坐标轴上的点,选一个点,使得其他点到该点曼哈顿距离和最小 分析:这题有很强的技巧性,直接计算每个点的曼哈顿距离和是不可行的.这里用到了前缀的思想,先对点按照x从左到右排序,p[ ...

  9. 贪心/数学 Codeforces Round #212 (Div. 2) A. Two Semiknights Meet

    题目传送门 /* 贪心/数学:还以为是BFS,其实x1 + 4 * k = x2, y1 + 4 * l = y2 */ #include <cstdio> #include <al ...

  10. 题解报告:hdu 1398 Square Coins(母函数或dp)

    Problem Description People in Silverland use square coins. Not only they have square shapes but also ...