libcurl error: Unable to link function recv
最近在Android上交叉编译libcurl库, 遇到` Unable to link function recv `, 但是同样的脚本, 在同事电脑上跑的好好的, 尴尬...这种环境问题是最烦人的了....
搜了下, 找到如下sof, 说这个函数 `-lz , which is the flag to link the zlib`.
https://stackoverflow.com/questions/44343570/cross-compiling-libcurl-for-arm-linux-gnueabihf-unable-to-link-function-recv
忽然想到前两天编译android源码, 手动下载安装了zlib, 于是`./configure; make; make uninstall`卸载zlib, 在重新编译便ok了.
成功提示如下:
checking for recv... yes
checking types of args and return type for recv... int,void *,size_t,unsigned int,int
这里给两个排bug的小tip:
set -x 显示执行的bash命令.
出错后, 找到config.log, 查看详细错误信息.