Mac OS 使用asio库

下载地址: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.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 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

时间: 2024-08-05 08:47:24

Mac OS 使用asio库的相关文章

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

尊重作者,支持原创,如需转载,请附上原地址:http://blog.csdn.net/libaineu2004/article/details/46234079 在Mac OS X下使用Qt开发,需要配置Qt库和编译器.编译器只能使用苹果公司自主研发的Clang.1.分别下载并安装XCode和Command Line Tools(必须安装),安装完毕后,Clang就有了. https://developer.apple.com/downloads/ 2.下载Qt并默认安装 http://down

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位的真机(arm64)指令集.需要重新编译查阅了下资料,按照如下步骤,并做了些注释和改动 1.http://sourceforge.net/projects/lame/files/lame/3.99/ 下载lame的最新版本解压到一个文件夹里例如 lame,全路径如下/Users/8wm/Desktop/lame 2.

Mac OS 安装boost

刚开始学习罗剑锋的<Boost程序库完全开发指南>,在Mac OS下按照Boost时出现了一些问题及解决方案. 环境:OS Yosemite(10.10.3) Xcode:version 6.3 Boost:1.58.0 操作步骤: 下载Boost并解压: 依次./bootstrap.sh ./b2 ./b2 install: 在Xcode中进行配置(控制台工程),build Setting中添加Header Search Paths和Library Search Paths(为步骤2中安装路

自己总结的 iOS ,Mac 开源项目以及库,知识点------持续更新

自己在 git  上看到一个非常好的总结的东西,但是呢, fork  了几次,就是 fork  不到我的 git 上,干脆复制进去,但是,也是认真去每一个每一个去认真看了,并且也是补充了一些,感觉非常棒,所以好东西要分享,为啥用 CN 博客,有个好处,可以随时修改,可以持续更新,不用每次都要再发表,感觉这样棒棒的 我们 自己总结的iOS.mac开源项目及库,持续更新.... github排名 https://github.com/trending,github搜索:https://github.

Mac OS安装Scrapy失败

报错: DEPRECATION: Uninstalling a distutils installed project (six) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project. Uninstalling six-1

Linux/Mac OS 个人常用Terminal技巧整理

刚开始接触linux有些不适应,走了不少弯路,一直没有系统的学过linux应用,基本都是零零散散Google出来的知识,在这里做个整理: Vi/Vim 基本操作: 刚开始接触linux时,不懂vi吃了不少亏.在命令行状态下,一旦用vi打开了文本只能通过重启来退出. vi/vim 分三种模式: 指令模式,编辑模式,选择模式. 只有在编辑模式下才能进行输入(不是绝对). 默认是"指令模式", 这个模式只支持vi/vim的指令, 在敲键盘时只会滴滴响. 不知道有多少人被这种方式搞晕过(晕不晕

Qt在Mac OS X下的编程环境搭建

尊重作者,支持原创,如需转载,请附上原地址:http://blog.csdn.net/libaineu2004/article/details/46234079 在Mac OS X下使用Qt开发,需要配置Qt库和编译器.编译器只能使用苹果公司自主研发的Clang.1.分别下载并安装XCode和Command Line Tools(必须安装),安装完毕后,Clang就有了. https://developer.apple.com/downloads/ 2.下载Qt并默认安装 http://down

使用CocoaPods的pod install 遇到的错误,未解决(Xcode版本v6.4,Mac OS版本v10.10.4)

转载请标明出处:http://blog.csdn.net/android_ls/article/details/47059957 一.CocoaPods 是一款很好的依赖管理工具,其安装步骤大致如下: 1.首先确保开发环境中已经安装了 Ruby(一般安装了 XCode,Ruby 会被自动安装上) 建议使用淘宝提供的 Gem源,在终端执行下列命令: $ gem sources --remove https://rubygems.org/ $ gem sources -a http://ruby.t

COCOA&#174; PROGRAMMING FOR MAC&#174; OS X (1)- Get Start

这个是Mac OS App开发学习的第一篇,希望是一个好的开始. 一.为什么要学习Mac OS App开发 a)长时间做IOS开发,发现自己所做的局限在苹果的一些库上面,一些底层的API却是私有的,不利于自己对操作系统的理解,学习Mac OS 可以增加对底层系统的理解,OC也有更广泛的应用空间. b) 平时使用Mac 发现上面的一些软件并不好用,如果自己写的话,相信可以写出更好的. c) Mac OS开发和其它所有的开发工作都一样,除了编码层次上面,更希望提高自己宏观的软件设计能力.扩展眼界,提