arm linux 接入百度sdk文字识别

百度ai开放平台

申请建立应用
下载sdk
编写client
在这里插入图片描述

移植依赖库

安装交叉编译工具
使用交叉编译工具编译库源码
在这里插入图片描述
交叉编译
交叉编译curl之前,要先交叉编译openssl,不然交叉编译curl失败
交叉编译openssl,先查看开发板已有的openssl版本
在这里插入图片描述
openssl 版本为1.0.2h
https://blog.csdn.net/weixin_44023406/article/details/103610397
交叉编译curl
https://blog.csdn.net/weixin_44023406/article/details/103617654

设置configure

CPPFLAGS="-I/usr/local/openssl/arm_openssl/include" LDFLAGS="-L/usr/local/openssl/arm_openssl/lib" LIBS="-ldl -lssl -lcrypto" ./configure --host=arm-linux CC=/usr/local/arm/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc CXX=/usr/local/arm/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ --with-ssl --enable-shared --enable-static --disable-dict --disable-ftp --disable-imap --disable-ldap --disable-ldaps --disable-pop3 --disable-proxy --disable-rtsp --disable-smtp --disable-telnet --disable-tftp --disable-zlib --without-ca-bundle --without-gnutls --without-libidn --without-librtmp --without-libssh2 --without-nss --without-zlib --prefix=/usr/local/curl/arm_curl

出现的问题
在这里插入图片描述
原因:LIBS="-ldl",未添加链接参数,添加后LIBS="-ldl -lssl -lcrypto"
添加后编译链接通过
问题解决办法参考https://www.xiaopingtou.cn/article-69209.html
移植curl
https://blog.csdn.net/wuzhiwuweisun/article/details/79129838
移植jsoncpp
https://blog.csdn.net/xiaoxianerqq/article/details/53490487
下载地址
https://github.com/open-source-parsers/jsoncpp
json版本>1.62
测试jsoncpp是否移植成功
在这里插入图片描述
在这里插入图片描述
交叉编译通过,在开发板上运行没问题

整个项目编译

在这里插入图片描述

问题

找不到openssl头文件

下载openssl库重新安装
https://blog.csdn.net/swjtu100/article/details/52093261?utm_medium=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachineLearnPai2-1.nonecase&depth_1-utm_source=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachineLearnPai2-1.nonecase

项目编译

在这里插入图片描述
开始以为找不到libcurl的函数定义,然后-L参数指定动态库文件位置还是不行,
然后看到warning:libssl.so.1.0.0找不到在这里插入图片描述
缺少第三方库链接参数 -lssl,加上后编译通过
在这里插入图片描述
然后把a.out放入开发板,执行
在这里插入图片描述
jsoncpp.so有问题,动态库文件没有放到/lib下,替换lib下的libjsoncpp.so,
在这里插入图片描述
拷入新的 版本libjsoncpp.so, 给权限
在这里插入图片描述
运行a.out
在这里插入图片描述
成功识别示例图片

  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值