Git Product home page Git Product logo

Comments (8)

j2doll avatar j2doll commented on August 16, 2024

Dear, @liufeijin

To build HelloQxlnt on Windows, you need to build two projects.
One is \Qxlnt\Qxlnt\Qxlnt.pro, the other is '\Qxlnt\HelloQXlnt\HelloQXlnt.pro'

1️⃣ First, Build Qxlnt(.dll & .lib) Using 'QT VS Tools'

  • Choose menu 'Open Qt Project File (*.pro) ...'
  • Select '\Qxlnt\Qxlnt\Qxlnt.pro' file
  • Then, select menu 'Build' > 'Batch Build'
  • Choose 'Select All' > 'Build'
  • ❗️ If If the build fails, log information of failure is required.

2️⃣ Second, Build HelloXnlt Using 'QT VS Tools'. The build step is the same as above.

  • ❗️ If If the build fails, log information of failure is required.

ℹ️ I built it in the following environment.

- Microsoft Windows 10 64bit
- Visual Studio 2017 64bit
- Qt 5.12.0 (VS2017/x64)
- Qt Visual Studio Tools 2.2.2

❕ If it does not build again, I need more accurate log information.

from qxlnt.

liufeijin avatar liufeijin commented on August 16, 2024

VS2017 Qtcreator4.8
The first step is ok get the lib.
The Second is fail.
main.obj👎 error: LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: void __cdecl xlnt::cell::value(int)" (_imp?value@cell@xlnt@@QEAAXH@Z),该符号在函数 main 中被引用
main.obj👎 error: LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: void __cdecl xlnt::cell::value(char const *)" (_imp?value@cell@xlnt@@QEAAXPEBD@Z),该符号在函数 main 中被引用
main.obj👎 error: LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: void __cdecl xlnt::workbook::save(class std::basic_string<char,struct std::char_traits,class std::allocator > const &)const " (_imp?save@workbook@xlnt@@QEBAXAEBV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@@z),该符号在函数 main 中被引用
release\HelloQxlnt.exe👎 error: LNK1120: 11 个无法解析的外部命令

from qxlnt.

liufeijin avatar liufeijin commented on August 16, 2024

suggest you to make a clear and simple include struct , like my QXlsx as below, anybody only need include the QXlsx.pri in his pro file of project.
https://github.com/liufeijin/QXlsx/blob/master/21225.png

from qxlnt.

j2doll avatar j2doll commented on August 16, 2024

Hi, Thanks for reporting.

1️⃣ If you are using Visual C++, xlnt is compiled as a DLL.
The setting of Qxlnt reflects the DLL compilation.
So it need more complicated settings than QXlsx.

2️⃣ Use Visual Studio 2017 and Qt 5.9.1 or higher version. Qt 4 is not supported for C++14.
xlnt uses C ++ 14. To use C ++ 14, use Visual Studio 2017.

For more Qt and Visual Studio version information, please see the link.

  • Qt 5.9.1 and later versions are pre-built for VS 2017 64 bits.
  • Qt 5.12.0 (LTS) comes with precompiled binaries for VS 2017 32 and 64 bits.

I tested on Qt 5.11.1 and Qt 5.12.0

from qxlnt.

liufeijin avatar liufeijin commented on August 16, 2024

I used QT5.12.0 Visual studio 2017 build in qtcreator.
failed.
I think maybe the patch of QXInt problem

from qxlnt.

liufeijin avatar liufeijin commented on August 16, 2024

Hi, Thanks for reporting.

1️⃣ If you are using Visual C++, xlnt is compiled as a DLL.
The setting of Qxlnt reflects the DLL compilation.
So it need more complicated settings than QXlsx.

2️⃣ Use Visual Studio 2017 and Qt 5.9.1 or higher version. Qt 4 is not supported for C++14.
xlnt uses C ++ 14. To use C ++ 14, use Visual Studio 2017.

For more Qt and Visual Studio version information, please see the link.

  • Qt 5.9.1 and later versions are pre-built for VS 2017 64 bits.
  • Qt 5.12.0 (LTS) comes with precompiled binaries for VS 2017 32 and 64 bits.

I tested on Qt 5.11.1 and Qt 5.12.0

I found where is the problem that build helloQXlnt need the Qxlnt.lib ( this lib is not the static lib )
So i rebuild QxLnt and got Qxlnt.dll and QxLnt.lib . copy to release folder and then ok

Generate a new excel file is ok,but don't know how to open a exit excel file modify and save.
QString filess="d:/1.xlsx";
wb.load(filess.toStdString());
xlnt::worksheet ws = wb.sheet_by_index(5); // 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("d:/1.xlsx"); // wb.save() can't use.
above code can't reach the target.

from qxlnt.

j2doll avatar j2doll commented on August 16, 2024

Congratulations on your success build.

Of course, _.lib is not a static lib. It is a lib for shared DLL.

To use xlnt, see xlnt document.
There are descriptions and examples.

from qxlnt.

liufeijin avatar liufeijin commented on August 16, 2024

Many thanks for your explain.
I checked the address , there are 3 simple . 1 generate a new excel file(i follow and ok)
1 is read a excel and qdebug out.
I rewrite the excel file generated by the simple code 1 , it is ok .
Can write , but has erroe also when i open the modified excel by office.
So i think i to be gave up QXlnt as it can't read the complex excel file.(error)
So only 1 way for us , it is QXlsx if you can repair the shared formula problem.

from qxlnt.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.