linux静态库引用顺序问题

出错的顺序 -g -o iec61850_test -lutil -lslog -lmem -lmlog -lpthread magic c++ 报错: make -f iec61850_test_DEBUG.mk ... gcc -c -o test.o -c -g -I/root/iec61850_test/inc -I/root/iec61850_test/inc/mmsop_en test.c gcc -c -o iec61850_zk.o -c -g -I/root/iec61850_test/inc -I/root/iec61850_test/inc/mmsop_en iec61850_zk.c gcc -c -o client.o -c -g -I/root/iec61850_test/inc -I/root/iec61850_test/inc/mmsop_en client.c gcc -g -o iec61850_test -L/root/iec61850_test/lib test.o iec61850_zk.o client.o -lutil -lslog -lmem -lmlog -lpthread /root/iec61850_test/lib/libmem.a(mem_chks.o)(.text+0xe61): In function `x_chk_free': //linuxsvr/root/iec61850/src/mem_chks.c(1073): undefined reference to `_slogHex' /root/iec61850_test/lib/libmem.a(mem_chks.o)(.text+0x1526): In function `chk_alloc_ptr': //linuxsvr/root/iec61850/src/mem_chks.c(1515): undefined reference to `_slogHex' /root/iec61850_test/lib/libmem.a(mem_chks.o)(.text+0x180b): In function `check_mem_list': //linuxsvr/root/iec61850/src/mem_chks.c(1631): undefined reference to `_slogHex' collect2: ld returned 1 exit status make: *** [iec61850_test] Error 1 Leave the directory: /root/iec61850_test 交换 -lslog -lmem 顺序后,编译成功。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值