#include <iostream>
#include "../libxl/include_cpp/libxl.h"
using namespace libxl;
int main()
{
Book* book = xlCreateBook(); // xlCreateXMLBook() for xlsx
if(book)
{
Sheet* sheet = book->addSheet(/*L*/"Sheet1");
if(sheet)
{
sheet->writeStr(2, 1, /*L*/"Hello, World !");
sheet->writeNum(3, 1, 1000);
}
book->save(/*L*/"example.xls");
book->release();
}
return 0;
}
It is giving this error:
C:\Users\abhijit\AppData\Local\Temp\cc2Ip6Ru.o:test2.cpp:(.text+0xf): undefined reference to `xlCreateBookA'
collect2.exe: error: ld returned 1 exit status
I think there is some linkage issue.
How can I fix/include this in the package for Sublime editor?
E.g. in Qt C++ package:
- add the following lines to a configuration file (.pro):
INCLUDEPATH = c:/libxl-3.6.4.0/include_cpp
LIBS += c:/libxl-3.6.4.0/lib/libxl.lib
- copy bin\libxl.dll to the build directory of your project
I was trying to compile C++ with libXL for Excel.
Here is the code:
It is giving this error:
I think there is some linkage issue. How can I fix/include this in the package for Sublime editor?
E.g. in Qt C++ package:
Please help!