无法使用 XLNT 库生成C++项目
Can't build C++ project with XLNT library
我正在尝试使用mingw g 在Windows 8下的XLNT-Library构建一个示例项目。该代码是GitHub文档中找到的示例代码:
#include <xlnt/xlnt.hpp>
int main()
{
xlnt::workbook wb;
xlnt::worksheet ws = wb.active_sheet();
ws.cell("A1").value(5);
ws.cell("B2").value("string data");
ws.cell("C3").formula("=RAND()");
ws.merge_cells("C3:C4");
ws.freeze_panes("B2");
wb.save("example.xlsx");
return 0;
}
我将库作为zip文件下载,提取它并复制文件夹[xlnt-master-root] include xlnt xlnt xlnt中的main.cpp居住的文件夹,然后尝试使用此命令进行编译:
g++ -std=c++14 -lxlnt -Ixlnt/include .excelTest.cpp -o excelTest.exe
,但这会导致以下错误:
c:/users/s/documents/myprogramms/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../../mingw32/bin/ld.exe:
cannot find -lxlnt
我还尝试将[XLNT-MASTER]文件夹复制到Main.CPP位置,并尝试以相同的结果进行编译。
我可以在C 中编程,但我以前从未与库合作。您能给我一个提示如何正确使用和编译该项目的图书馆?
fyi:我还尝试使用CMAKE构建图书馆,如这里所示。尽管Cmake取得了成功,但Make -j8不会做任何事情,因为在构建目录中没有创建makefile。也许我在这里错了?
感谢您的帮助...
使用持续的 Visual Studio 2017 ,您可以构建 Xlnt library automatic。
您可以下载下面的库:
https://1drv.ms/f/s!3yanq3dydem1g9mtinwww7cyth
相关文章:
- 使用C++库在Android项目中修改gradle中的cmake参数,用于插入指令的测试
- 无法在 CLion 中构建 C++ 项目
- 运行同一解决方案的另一个项目的项目
- CMake-按正确顺序将项目与C运行时对象文件链接
- 如何在选项卡视图Qt中设置一个新项目,并保存以前的项目
- 欧拉项目#8答案是大以获得有效答案
- 从链接列表c++中删除一个项目
- CMake项目Boost库错误:Boost/config/compiler/gcc.hpp:165:10:致命错误:cs
- 既然存在危险,为什么项目要使用-I include开关
- cmake在我的项目中所需的所有静态库都不成功
- QT通过C++添加映射QML项目
- 我的项目不会像"undefined reference to `grpc::g_core_codegen_interface'"那样使用未定义的引用错误进行编译
- 在linux上调试巨大的C++项目
- 在其他文件中创建类时在 c++ 项目中不起作用
- 使外部项目可用于find_package CMake
- 在子目录中使用target_sources()命令时用于单元测试(qtest)的项目结构
- 使用外部SDK工具链文件在VisualStudio上生成项目编译错误
- 如何维护资源管理器项目视图中当前可见的项目列表
- 错误-我无法在VS2019中打开新的Qt项目
- 你能检查一下为什么在这个代码中从链接列表中删除项目不起作用吗