本篇文章在https://blog.csdn.net/baidu_30174103/article/details/80463802首发,转载请注明出处!
C++操作excel(利用github上的项目:xlnt):
1:安装cmake:这个比较简单,安装教程参考:
https://blog.csdn.net/sinat_36264666/article/details/73177703
2:下载xlnt:
https://github.com/tfussell/xlnt
3:cmake xlnt ,命令如下
cd xlnt-master
mkdir build
cd build
cmake ..
4.用vs打开xlnt-master\build\xlnt_all.sln,生成解决方案
5.在 xlnt-master\include中得到头文件,在xlnt-master\build\source\Debug中得到动态链接库
静态编译:
在上面第三步前修改xlnt-master\CMakeLists.txt
# Library type
option(STATIC "Set to ON to build xlntas a static library instead of a shared library" OFF)
把上面的OFF改为ON
这样就能编译出静态链接库
注意,在使用静态链接库时,