Error: undefined reference to png_check_sig

本文介绍了解决使用新版本libpng库时遇到的png_check_sig函数被移除的问题。通过将gd库中的gd_png.c文件内的png_check_sig替换为png_sig_cmp,成功解决了编译错误。

undefined reference to png_check_sig

编译MRF-benchmark的时候,在编译过程中碰到 undefined reference to `png_check_sig’ 错误。
google了一下,发现由于使用的新的 libpng 1.5(1.4也是)版本,去掉了png_check_sig函数,替换为了png_sig_check函数
,于是编辑gd库的 gd_png.c文件,将

  1. if (!png_check_sig (sig, 8)) { /* bad signature */
  2. return NULL;
  3. }

修改为

  1. if (png_sig_cmp (sig, 0, 8)) { /* bad signature */
  2. return NULL;
  3. }

再次编译通过


tools/lib/ecdsa/ecdsa-libcrypto.o: In function `prepare_ctx': ecdsa-libcrypto.c:(.text+0xcd): undefined reference to `OPENSSL_init_ssl' ecdsa-libcrypto.c:(.text+0x185): undefined reference to `EC_GROUP_order_bits' tools/lib/ecdsa/ecdsa-libcrypto.o: In function `ecdsa_check_signature.isra.3': ecdsa-libcrypto.c:(.text+0x3ad): undefined reference to `ECDSA_SIG_set0' tools/lib/ecdsa/ecdsa-libcrypto.o: In function `ecdsa_sign': ecdsa-libcrypto.c:(.text+0x497): undefined reference to `ECDSA_SIG_get0' ecdsa-libcrypto.c:(.text+0x4ae): undefined reference to `BN_bn2binpad' ecdsa-libcrypto.c:(.text+0x4c0): undefined reference to `BN_bn2binpad' tools/lib/ecdsa/ecdsa-libcrypto.o: In function `ecdsa_add_verify_data': ecdsa-libcrypto.c:(.text+0x68a): undefined reference to `EC_GROUP_order_bits' ecdsa-libcrypto.c:(.text+0x6d2): undefined reference to `EC_POINT_get_affine_coordinates' collect2: error: ld returned 1 exit status make-4.1[2]: *** [tools/dumpimage] Error 1 make-4.1[2]: *** Waiting for unfinished jobs.... tools/lib/ecdsa/ecdsa-libcrypto.o: In function `prepare_ctx': ecdsa-libcrypto.c:(.text+0xcd): undefined reference to `OPENSSL_init_ssl' ecdsa-libcrypto.c:(.text+0x185): undefined reference to `EC_GROUP_order_bits' tools/lib/ecdsa/ecdsa-libcrypto.o: In function `ecdsa_check_signature.isra.3': ecdsa-libcrypto.c:(.text+0x3ad): undefined reference to `ECDSA_SIG_set0' tools/lib/ecdsa/ecdsa-libcrypto.o: In function `ecdsa_sign': ecdsa-libcrypto.c:(.text+0x497): undefined reference to `ECDSA_SIG_get0' ecdsa-libcrypto.c:(.text+0x4ae): undefined reference to `BN_bn2binpad' ecdsa-libcrypto.c:(.text+0x4c0): undefined reference to `BN_bn2binpad' tools/lib/ecdsa/ecdsa-libcrypto.o: In function `ecdsa_add_verify_data': ecdsa-libcrypto.c:(.text+0x68a): undefined reference to `EC_GROUP_order_bits' ecdsa-libcrypto.c:(.text+0x6d2): undefined reference to `EC_POINT_get_affine_coordinates' collect2: error: ld returned 1 exit status make-4.1[2]: *** [tools/fit_info] Error 1 tools/lib/ecdsa/ecdsa-libcrypto.o: In function `prepare_ctx': ecdsa-libcrypto.c:(.text+0xcd): undefined reference to `OPENSSL_init_ssl' ecdsa-libcrypto.c:(.text+0x185): undefined reference to `EC_GROUP_order_bits' tools/lib/ecdsa/ecdsa-libcrypto.o: In function `ecdsa_check_signature.isra.3': ecdsa-libcrypto.c:(.text+0x3ad): undefined reference to `ECDSA_SIG_set0' tools/lib/ecdsa/ecdsa-libcrypto.o: In function `ecdsa_sign': ecdsa-libcrypto.c:(.text+0x497): undefined reference to `ECDSA_SIG_get0' ecdsa-libcrypto.c:(.text+0x4ae): undefined reference to `BN_bn2binpad' ecdsa-libcrypto.c:(.text+0x4c0): undefined reference to `BN_bn2binpad' tools/lib/ecdsa/ecdsa-libcrypto.o: In function `ecdsa_add_verify_data': ecdsa-libcrypto.c:(.text+0x68a): undefined reference to `EC_GROUP_order_bits' ecdsa-libcrypto.c:(.text+0x6d2): undefined reference to `EC_POINT_get_affine_coordinates' collect2: error: ld returned 1 exit status make-4.1[2]: *** [tools/fit_check_sign] Error 1 make[1]: *** [tools] Error 2 Makefile:413: recipe for target 'uboot' failed make: *** [uboot] Error 2
最新发布
12-11
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值