【已解决】【TuyaOS SDK】用libtuyaos.a中自带的mbedtls, 链接时报错

IPC/NVR/可视门铃等具备多媒体能力的设备,扫地机/AGV等机器人设备


Post Reply
19926824531
Posts: 196

你好,我这边编译了一个基于mbedtls的 libcurl.a,链接时发现缺少以下的几个接口,请问SDK是去掉了哪些mbedtls特性呢?
这个冲突问题应该如何解决呢?

mips-linux-uclibc-g++ -Wl,-gc-sections -ffunction-sections -fdata-sections -muclibc -lrt -ldl -L/vm_disk/Code/D2PT_Compare/09_T23N_D2PT/Cam/dependence/PPCS/lib -L/vm_disk/Code/D2PT_Compare/09_T23N_D2PT/Cam/dependence/WiPN/lib -L/vm_disk/Code/D2PT_Compare/09_T23N_D2PT/Cam/dependence/tuya/lib -L/vm_disk/Code/D2PT_Compare/09_T23N_D2PT/Cam/dependence/zbar/lib -L/vm_disk/Code/D2PT_Compare/09_T23N_D2PT/Cam/dependence/faac/lib -L/vm_disk/Code/D2PT_Compare/09_T23N_D2PT/Cam/dependence/LWRsa/lib -L/vm_disk/Code/D2PT_Compare/09_T23N_D2PT/Cam/dependence/VoiceReg/lib -L/vm_disk/Code/D2PT_Compare/09_T23N_D2PT/Cam/dependence/zwpush/lib -L/vm_disk/Code/D2PT_Compare/09_T23N_D2PT/Cam/dependence/libcurl/lib -L/vm_disk/Code/D2PT_Compare/09_T23N_D2PT/Cam/dependence/libjpeg/lib -L/vm_disk/Code/D2PT_Compare/09_T23N_D2PT/Cam/dependence/mbedtls/lib -L/vm_disk/Code/D2PT_Compare/09_T23N_D2PT/Cam/dependence/ingenic/t23_sdk/lib -L/vm_disk/Code/D2PT_Compare/09_T23N_D2PT/Cam/dependence/ingenic/t23_personDet/IVS/lib -L/vm_disk/Code/D2PT_Compare/09_T23N_D2PT/Cam/dependence/ingenic/t23_personDet/MXU/lib -L/vm_disk/Code/D2PT_Compare/09_T23N_D2PT/Cam/Output/D2PT-46PHL-SW/lib -o /vm_disk/Code/D2PT_Compare/09_T23N_D2PT/Cam/src/../Output/D2PT-46PHL-SW/bin/EasyCam /vm_disk/Code/D2PT_Compare/09_T23N_D2PT/Cam/src/../Output/D2PT-46PHL-SW/obj/*.o -lLWRsa -ltuyaos -lzbar -lPPCS_API -lNDT_API_PPCS -lSPS_API -lcurl -lfaac -limp -lsysutils -lalog -lpersonDet_inf -ljzdl -lmxu_merge -lmxu_video -lmxu_imgproc -lmxu_core -ljpeg -lpthread -lm
/vm_disk/Code/D2PT_Compare/09_T23N_D2PT/Cam/dependence/tuya/lib/libtuyaos.a(tuya_ipc_ss_util.c.o): In function __change_timezone_of_file_time':
tuya_ipc_ss_util.c:(.text.__change_timezone_of_file_time+0x58): warning: the use of OBSOLESCENT
utime' is discouraged, use utimes'
/vm_disk/Code/D2PT_Compare/09_T23N_D2PT/Cam/dependence/tuya/lib/libtuyaos.a(tal_network.c.o): In function
tal_net_gethostbyname':
tal_network.c:(.text.tal_net_gethostbyname+0x60): warning: gethostbyname_r is obsolescent, use getnameinfo() instead.
/vm_disk/Code/D2PT_Compare/09_T23N_D2PT/Cam/src/../Output/D2PT-46PHL-SW/obj/HTTPClientWrapper.o: In function HTTPWrapperGetHostByName':
HTTPClientWrapper.c:(.text.HTTPWrapperGetHostByName+0xd4): warning: gethostbyname is obsolescent, use getnameinfo() instead.
/vm_disk/Code/D2PT_Compare/09_T23N_D2PT/Cam/dependence/libcurl/lib/libcurl.a(libcurl_la-mbedtls.o): In function
mbed_connect_common':
mbedtls.c:(.text+0x7a0): undefined reference to mbedtls_x509_crt_parse_file'
mbedtls.c:(.text+0x7bc): undefined reference to
mbedtls_x509_crt_parse_path'
mbedtls.c:(.text+0x7f8): undefined reference to mbedtls_x509_crt_parse_file'
mbedtls.c:(.text+0x838): undefined reference to
mbedtls_pk_parse_keyfile'
mbedtls.c:(.text+0xa44): undefined reference to mbedtls_x509_crl_init'
mbedtls.c:(.text+0xa58): undefined reference to
mbedtls_x509_crl_parse_file'
mbedtls.c:(.text+0xd54): undefined reference to mbedtls_net_recv'
mbedtls.c:(.text+0xd5c): undefined reference to
mbedtls_net_recv'
mbedtls.c:(.text+0xd58): undefined reference to mbedtls_net_send'
mbedtls.c:(.text+0xd60): undefined reference to
mbedtls_net_send'
/vm_disk/Code/D2PT_Compare/09_T23N_D2PT/Cam/dependence/libcurl/lib/libcurl.a(libcurl_la-mbedtls.o): In function Curl_mbedtls_close':
mbedtls.c:(.text+0xf84): undefined reference to
mbedtls_x509_crl_free'
/vm_disk/Code/D2PT_Compare/09_T23N_D2PT/Cam/dependence/libcurl/lib/libcurl.a(libcurl_la-mbedtls.o): In function Curl_mbedtls_version':
mbedtls.c:(.text+0x1008): undefined reference to
mbedtls_version_get_number'
collect2: error: ld returned 1 exit status
Makefile:206: recipe for target 'EasyCam' failed
make[1]: *** [EasyCam] Error 1
Makefile:59: recipe for target 'app' failed
make: *** [app] Error 2
root@ubuntu:/vm_disk/Code/D2PT_Compare/09_T23N_D2PT/Cam#

Last edited by 19926824531 on 2024年 Jan 11日 10:47, edited 2 times in total.

Tags:
19926824531
Posts: 196

Re: 【求助】用libtuyaos.a中自带的mbedtls, 链接时报错

这个是我这边编译curl时的配置:

./configure --prefix=$(pwd)/build_lib --host=mips-linux-uclibc CC=mips-linux-uclibc-gcc CXX=mips-linux-uclibc-g++ --enable-shared=no --enable-static=yes --enable-optimize --disable-telnet --disable-largefile --disable-ftp --disable-smtp --disable-imap --without-libssh2 --without-zlib --without-librtmp --without-libidn --without-gnutls --disable-ldap --disable-ldaps --disable-pop3 --disable-netrc --disable-mime --disable-socketpair --disable-debug --disable-curldebug --disable-symbol-hiding --disable-dict --disable-rtsp --disable-gopher --disable-file --disable-tftp --disable-manual --disable-sspi --disable-ntlm-wb --disable-tls-srp --disable-soname-bump --disable-manual --disable-smb --disable-smbs --disable-unix-sockets --disable-ipv6 --disable-mqtt CFLAGS="-march=mips32r2 -muclibc" --with-mbedtls=/vm_disk/Code/D2PT_Compare/09_T23N_D2PT/Cam/dependence/mbedtls

User avatar
pippin-bobo
Posts: 236

Re: 【求助】用libtuyaos.a中自带的mbedtls, 链接时报错

1)可以看一下libtuyaos.a库的符号表,有些mbedtls接口还是有的,是不是链接顺序问题
2)是什么业务场景你们还需要集成自己的http等服务

19926824531
Posts: 196

Re: 【求助】用libtuyaos.a中自带的mbedtls, 链接时报错

(1)这些报 "未定义引用" 的符号表 libtuyaos.a中没有的

root@ubuntu:/vm_disk/Code/D2PT_Compare/09_T23N_D2PT/Cam/dependence/tuya/lib# ls
libtuyaos.a
root@ubuntu:/vm_disk/Code/D2PT_Compare/09_T23N_D2PT/Cam/dependence/tuya/lib# grep -Rn "mbedtls_x509_crt_parse_path"
root@ubuntu:/vm_disk/Code/D2PT_Compare/09_T23N_D2PT/Cam/dependence/tuya/lib#

(2)厂测模式下会用到 http服务

User avatar
pippin-bobo
Posts: 236

Re: 【已解决】【求助】用libtuyaos.a中自带的mbedtls, 链接时报错

请问产测什么场景会使用http,如果对接涂鸦服务,建议使用使用涂鸦的产测协议

Post Reply