当前位置: 首页 > java >正文

在aarch64平台编译写入传统xls格式文件开源库xlslib的步骤

1.从xlslib主页下载源代码包xlslib-package-2.5.0.zip。
2.与平常的软件包不同,解压后首先要执行bootstrap脚本。
3.执行bootstrap脚本完成后,执行configure脚本。报错了

checking build system type... config/config.guess: unable to guess system typeThis script, last modified 2009-06-10, has failed to recognize
the operating system you are using. It is advised that you
download the most up to date version of the config scripts fromhttp://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
andhttp://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEADIf the version you run (config/config.guess) is already up to date, please
send the following data and any information you think might be
pertinent to <config-patches@gnu.org> in order to provide the needed
information to handle your system.config.guess timestamp = 2009-06-10

注意这是一个2009年的软件包,那时aarch64还没有流行起来,所以脚本不能猜出我的平台,要上gnu网站下载更新的以上两个文件来替换config目录中config.guess和config.sub。
替换完毕后,再次执行configure脚本,这次成功生成了Makefile。
4.执行make
在输出很多编译文件信息后,又报错了,

...
../../src/.libs/libxls.a(continue.o):(.rodata._ZTIN11xlslib_core9CContinueE[_ZTIN11xlslib_core9CContinueE]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
collect2: error: ld returned 1 exit status
Makefile:634: recipe for target 'testC' failed
make[2]: *** [testC] Error 1
make[2]: Leaving directory '/shujv/par/xlslib/targets/test'
Makefile:364: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/shujv/par/xlslib/targets'
Makefile:461: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1

但是targets/test下确实生成了testCPP文件,执行此文件,成功生成了各种xls文件。再观察它的中间目录,…/…/src/.libs/,虽然没有生成libxls.a,但相应的so文件是有的,正好我们要用的就是so文件,所以这个报错不影响。

/shujv/par/xlslib$ cd targets/test
/shujv/par/xlslib/targets/test$ ./testCPP# Test finished/shujv/par/xlslib/src/.libs$ ls -l libxls.so*
lrwxrwxrwx 1 kylin kylin      15 66 09:08 libxls.so -> libxls.so.3.0.0
lrwxrwxrwx 1 kylin kylin      15 66 09:08 libxls.so.3 -> libxls.so.3.0.0
-rwxrwxr-x 1 kylin kylin 3610952 66 09:08 libxls.so.3.0.0

将它们复制到我存放so文件的目录,然后,用我们自己的程序去调用这个库,成功。

g++ -std=c++14 excel_benchmark.cpp BasicExcel.cpp -o excel_benchmarkw -DUSE_BASICEXCEL -DUSE_XLSLIB -I /par/xlslib/src -O3 -lxls./excel_benchmarkw
Benchmark report saved to benchmark_results.xls

补记:这个xlslib库是在g++ 5.4版本下编译的so文件,但不影响我用g++ 14编译的源代码用-lxls命令选项动态链接它。

http://www.xdnf.cn/news/12355.html

相关文章:

  • 《影像引导下骨盆创伤手术的术前骨折复位规划:基于学习的综合流程》|文献速递-深度学习医疗AI最新文献
  • [论文阅读]TrustRAG: Enhancing Robustness and Trustworthiness in RAG
  • 密码学基础——SM4算法
  • 飞云智能波段主图+多空短线决策副图指标,组合操盘技术图文解说
  • 网页端 js 读取发票里的二维码信息(图片和PDF格式)
  • 机器学习算法时间复杂度解析:为什么它如此重要?
  • 国内环境修改 flutter.bat 来设置 flutter 的网络环境
  • Java项目中常用的中间件及其高频问题避坑
  • 第7篇:中间件全链路监控与 SQL 性能分析实践
  • 区块链电子发票试点政策DID数据(2016-2025)
  • 绕过 Xcode?使用 Appuploader和主流工具实现 iOS 上架自动化
  • 【001】frida API分类 总览
  • Spring Boot 定时任务的使用
  • 从webrtc到janus简介
  • vue-21 (使用 Vuex 模块和异步操作构建复杂应用)
  • 单元测试与QTestLib框架使用
  • 字符串 金额转换
  • 简约商务年终工作总结报告PPT模版分享
  • Qt(part1)Qpushbutton,信号与槽,对象树,自定义信号与槽,lamda表达式。
  • LRU 和 DiskLRU实现相册缓存器
  • coze平台创建智能体,关于智能体后端接入的问题
  • Typeerror: cannot read properties of undefined (reading ‘XXX‘)
  • 【Linux】(1)—进程概念-④fork、僵尸进程、孤儿进程
  • 【Linux】(1)—进程概念-⑤进程调度
  • 如何把本地服务器变成公网服务器?内网ip网址转换到外网连接访问
  • 国芯思辰| AD7894的优质替代方案:SC1424模数转换器在分布式控制系统中的应用优势
  • I2C通信讲解
  • Git的由来与应用详解:从Linux内核到现代开发的革命性工具
  • Shell基础
  • 记录一次 apt-key curl导入失败的处理方式