zlog移植全记录

源码下载

https://github.com/HardySimpson/zlog/releases

zlog1.2.17编译安装

make CC=mipsel-openwrt-linux-gcc
make PREFIX=/opt/armlib_mipsel/libzlog install

老版本编译安装

$ ./configure --prefix=/opt/armlib_mipsel/libzlog --host=mipsel-openwrt-linux CC=mipsel-openwrt-linux-gcc
$ make 
$ make install

prefix:安装路径设置
host:运行环境设置
CC:工具链设置

全过程问题记录

$  make
Making all in doc
make[1]: Entering directory '/opt/armsrc/zlog/doc'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/opt/armsrc/zlog/doc'
Making all in src
make[1]: Entering directory '/opt/armsrc/zlog/src'
../mipsel-openwrt-linux-libtool  --tag=CC   --mode=link mipsel-openwrt-linux-gcc -I. -g -O2   -o zlog-chk-conf zlog_chk_conf-zlog-chk-conf.o libzlog.la -lpthread 
mipsel-openwrt-linux-libtool: link: mipsel-openwrt-linux-gcc -I. -g -O2 -o .libs/zlog-chk-conf zlog_chk_conf-zlog-chk-conf.o  ./.libs/libzlog.so -lpthread -Wl,-rpath -Wl,/opt/armlib_mipsel/libzlog/lib
./.libs/libzlog.so: undefined reference to `rpl_realloc'
collect2: error: ld returned 1 exit status
Makefile:501: recipe for target 'zlog-chk-conf' failed
make[1]: *** [zlog-chk-conf] Error 1
make[1]: Leaving directory '/opt/armsrc/zlog/src'
Makefile:429: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1

问题:没有rpl_realloc,修改根目录与src目录下的Makefile,将“rpl_realloc”修改为“realloc”,修改后要make clean再make

$ make clean
$ make

扩展内容

zlog使用手册,该手册介绍详细了zlog的方法,很实用

其他问题摘录

下载源码后
cd 到文件夹下,对 autogen.sh 添加可执行权限:chmod +x autogen.sh
然后执行:./autogen.sh
如果出现不能识别的函数错误,或报”Syntax error: “(” unexpected 的错误,请取消dash:
dpkg-reconfigure dash
选择 no ;然后再执行:./autogen.sh

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值