根据报错信息“configure: error: off_t undefined; check your library configuration”分析,未定义的类型 off_t。
off_t 类型是在头文件 unistd.h中定义的,在32位系统 编程成 long int ,64位系统则编译成 long long int ,当系统是 64位的时候,在进行编译的时候是默认查找64位的动态链接库,但是默认情况下 centos 的动态链接库配置文件/etc/ld.so.conf里并没有加入搜索路径,这个时候需要将 /usr/local/lib64 /usr/lib64 这些针对64位的库文件路径加进去。
所以有一种解决办法:
# 添加搜索路径到配置文件 echo '/usr/local/lib64 /usr/local/lib /usr/lib /usr/lib64'>>/etc/ld.so.conf # 更新配置 ldconfig -v