最近在开发一个采集器的项目,需要将数据存为csv,xlsx,xls等格式,发现后面2中各种qt没有现成的包,因此我们通过第三方平台的包进行编译安装,我们去下载源码,网址如下https://github.com/dbzhang800/qtxlsxwriter 。然后开始按照里面的文档进行编译,如图所示
然后分别执行下面的命令
qmake
make
make install
如果执行到make报错'perl' 不是内部或外部命令,也不是可运行的程序,直接去网址下载即可,网址为https://strawberryperl.com/ 。
安装完后在cmd命令输入
perl -v
如果显示如下,表示安装成功
C:\Users\14499>perl -v
Locale 'Chinese (Simplified)_China.936' is unsupported, and may crash the interpreter.
This is perl 5, version 38, subversion 0 (v5.38.0) built for MSWin32-x64-multi-thread
Copyright 1987-2023, Larry Wall
Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.
Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl". If you have access to the
Internet, point your browser at https://www.perl.org/, the Perl Home Page.
然后就可以继续make,make install命令了,最后在pro文件中加上QT += xlsx即可,然后再cpp中加入
#include<QtXlsx>
即可,完美解决!
点击此处登录后即可评论