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. 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库的更多相关文章
- 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 ...
- AppCode 中开发 Mac OS X 应用程序或共享库的经验小结
AppCode 是 JetBrains 公司出品的用于开发 Mac OS X 及 iOS 应用程序的集成开发环境,只能运行于 Mac OS X 操作系统环境下,作为 XCode 的高级替代品.由于其基 ...
- 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 ...
- Qt在Mac OS X下的编程环境搭建(配置Qt库和编译器,有图,很清楚)
尊重作者,支持原创,如需转载,请附上原地址:http://blog.csdn.net/libaineu2004/article/details/46234079 在Mac OS X下使用Qt开发,需要 ...
- Mac os 下 python爬虫相关的库和软件的安装
由于最近正在放暑假,所以就自己开始学习python中有关爬虫的技术,因为发现其中需要安装许多库与软件所以就在这里记录一下以避免大家在安装时遇到一些不必要的坑. 一. 相关软件的安装: 1. h ...
- 记录Mac OS下编译Thrift库
方法一:brew管理工具安装Homebrew是Mac开发包管理工具,类似于Linux的apt-get之类的,实它相当于开发软件界的 Appstore.借助该管理工具,可以自动化地安装软件包,它会自动安 ...
- ROS2 MAC OS Install
ROS2 MAC OS Install(非原创),安装过程记录一下 注意: (1)如果安装了anaconda,请将~/.bash_profile文件中的export PATH="/anaco ...
- 在Mac OS X中配置Apache + PHP + MySQL
在Mac OS X中配置Apache + PHP + MySQL Mac OS X 内置Apache 和 PHP,使用起来非常方便.本文以Mac OS X 10.6.3和为例.主要内容包括: 启动Ap ...
- Mac OS X 上安装 ASP.NET 5
在Mac OS X Yosemite 10.10.3 中搭建第一个 ASP.NET 5 Web 项目 终于有时间在 Mac 上安装一下 ASP.NET 5,网上有许多教程,但是多数的时间比较早了,版本 ...
随机推荐
- django flask缓存memcache的key生成方法介绍
去年的一个django项目中,使用了memcache作为系统缓存,并实现多台机器上的缓存共享.配置的cache如下图所示: 最近在项目调试过程中,发现memcache在进行缓存时,使用的key并不是实 ...
- vue 子组件 索引 ref
尽管有props和events,但是有时任然需要在javascript中直接访问子组件.为此可是使用ref为子组件指定一个索引ID. <div id="parent"> ...
- Spring Cloud 与 Dubbo 区别
Dubbo Spring Cloud 服务注册中心 Zookeeper Spring Cloud Netflix Eureka 服务调用方式 RPC REST API 服务监控 Dubbo-mon ...
- POJ3233:Matrix Power Series(矩阵快速幂+递推式)
传送门 题意 给出n,m,k,求 \[\sum_{i=1}^kA^i\] A是矩阵 分析 我们首先会想到等比公式,然后得到这样一个式子: \[\frac{A^{k+1}-E}{A-E}\] 发现要用矩 ...
- 各个nginx conf的虚拟主机的配置
server { listen 80; server_name t-cl.orangevip.com; rewrite ^(.*)$ https://$host$1 permanent;} serve ...
- [poj2096] Collecting Bugs【概率dp 数学期望】
传送门:http://poj.org/problem?id=2096 题面很长,大意就是说,有n种bug,s种系统,每一个bug只能属于n中bug中的一种,也只能属于s种系统中的一种.一天能找一个bu ...
- .Net Framework Client Profile 和 .Net Framework的区别[转]
原文链接 VS2010默认是以.Net Framework Client Profile为生成环境的,如果需要更多的功能,应该调用.Net Framework.
- 417 Pacific Atlantic Water Flow 太平洋大西洋水流
详见:https://leetcode.com/problems/pacific-atlantic-water-flow/description/ C++: class Solution { publ ...
- vijos P1426兴奋剂检查 多维费用背包问题的hash
https://vijos.org/p/1426 这是个好题,容易想到用dp[i][v1][v2][v3][v4][v5]表示在前i个物品中,各种东西的容量是那个的时候,能产生的最大价值. 时间不会T ...
- YUM报错及解决办法
[root@xuegod60 ~]# yum clean all Loaded plugins: product-id, refresh-packagekit, security, subscript ...