Mac OS 使用asio库

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

本人下载的版本:asio-1.12.2

1,本人环境:

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

2. cd到下载的库目录

1dengzhongqiangdeMacBook-Pro:asio-1.12.2 dengzhongqiang$ ./configure 2checking whether to enable maintainer-specific portions of Makefiles... no 3checking for a BSD-compatible install... /usr/bin/install -c 4checking whether build environment is sane... yes 5checking for a thread-safe mkdir -p... ./install-sh -c -d 6checking for gawk... no 7checking for mawk... no 8checking for nawk... no 9checking for awk... awk 10checking whether make sets $(MAKE)... yes 11checking whether make supports nested variables... yes 12checking whether UID '501' is supported by ustar format... yes 13checking whether GID '20' is supported by ustar format... yes 14checking how to create a ustar tar archive... gnutar 15checking build system type... x86_64-apple-darwin18.5.0 16checking host system type... x86_64-apple-darwin18.5.0 17checking whether make supports the include directive... yes (GNU style) 18checking for gcc... gcc 19checking whether the C compiler works... yes 20checking for C compiler default output file name... a.out 21checking for suffix of executables... 22checking whether we are cross compiling... no 23checking for suffix of object files... o 24checking whether we are using the GNU C compiler... yes 25checking whether gcc accepts -g... yes 26checking for gcc option to accept ISO C89... none needed 27checking whether gcc understands -c and -o together... yes 28checking dependency style of gcc... gcc3 29checking for g++... g++ 30checking whether we are using the GNU C++ compiler... yes 31checking whether g++ accepts -g... yes 32checking dependency style of g++... gcc3 33checking for ranlib... ranlib 34checking how to run the C++ preprocessor... g++ -E 35checking for grep that handles long lines and -e... /usr/bin/grep 36checking for egrep... /usr/bin/grep -E 37checking for ANSI C header files... yes 38checking for sys/types.h... yes 39checking for sys/stat.h... yes 40checking for stdlib.h... yes 41checking for string.h... yes 42checking for memory.h... yes 43checking for strings.h... yes 44checking for inttypes.h... yes 45checking for stdint.h... yes 46checking for unistd.h... yes 47checking boost/noncopyable.hpp usability... yes 48checking boost/noncopyable.hpp presence... yes 49checking for boost/noncopyable.hpp... yes 50checking openssl/ssl.h usability... no 51checking openssl/ssl.h presence... no 52checking for openssl/ssl.h... no 53checking whether C++11 is enabled... no 54checking whether C++14 is enabled... no 55checking that generated files are newer than configure... done 56configure: creating ./config.status 57config.status: creating Makefile 58config.status: creating include/Makefile 59config.status: creating src/Makefile 60config.status: creating src/tests/Makefile 61config.status: creating src/examples/cpp03/Makefile 62config.status: creating src/examples/cpp11/Makefile 63config.status: creating src/examples/cpp14/Makefile 64config.status: creating src/examples/cpp17/Makefile 65config.status: executing depfiles commands

3.执行make

1dengzhongqiangdeMacBook-Pro:asio-1.12.2 dengzhongqiang$ make 2Making all in include 3make[1]: Nothing to be done for `all'. 4Making all in src 5Making all in examples/cpp03 6g++ -I./../../../include -g -O2 -ftemplate-depth-256 -o icmp/ping icmp/ping.o 7Undefined symbols for architecture x86_64: 8 "boost::chrono::steady_clock::now()", referenced from: 9 pinger::start_send() in ping.o 10 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 11 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 12 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 13 pinger::handle_receive(unsigned long) in ping.o 14ld: symbol(s) not found for architecture x86_64 15clang: error: linker command failed with exit code 1 (use -v to see invocation) 16make[2]: *** [icmp/ping] Error 1 17make[1]: *** [all-recursive] Error 1 18make: *** [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
点赞
收藏

评论区

加载中...

相关推荐

MySQL:[Err] 1292 - Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column ‘CREATE_TIME‘ at row 1

文章目录问题用navicat导入数据时,报错:原因这是因为当前的MySQL不支持datetime为0的情况。解决修改sql\mode:sql\mode:SQLMode定义了MySQL应支持的SQL语法、数据校验等,这样可以更容易地在不同的环境中使用MySQL。全局s

Oracle 分组与拼接字符串同时使用

SELECTT.,ROWNUMIDFROM(SELECTT.EMPLID,T.NAME,T.BU,T.REALDEPART,T.FORMATDATE,SUM(T.S0)S0,MAX(UPDATETIME)CREATETIME,LISTAGG(TOCHAR(

MySQL部分从库上面因为大量的临时表tmp_table造成慢查询

背景描述Time:20190124T00:08:14.70572408:00User@Host:@Id:Schema:sentrymetaLast_errno:0Killed:0Query_time:0.315758Lock_

皕杰报表之UUID

​在我们用皕杰报表工具设计填报报表时,如何在新增行里自动增加id呢?能新增整数排序id吗?目前可以在新增行里自动增加id,但只能用uuid函数增加UUID编码,不能新增整数排序id。uuid函数说明:获取一个UUID,可以在填报表中用来创建数据ID语法:uuid()或uuid(sep)参数说明:sep布尔值,生成的uuid中是否包含分隔符'',缺省为

手写Java HashMap源码

HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程22

2020年前端实用代码段,为你的工作保驾护航

有空的时候,自己总结了几个代码段,在开发中也经常使用,谢谢。1、使用解构获取json数据let jsonData  id: 1,status: "OK",data: 'a', 'b';let  id, status, data: number   jsonData;console.log(id, status, number )