Optimus1
Optimus1

Reputation: 448

How to compile/build/link - the XLNT library?

I downloaded the xlnt library for working with Excel - https://github.com/tfussell/xlnt. Can you please tell me what to do with it further? Honestly, I still can’t understand how among all the files there are in the downloaded archive, and there are 100 of them .hpp and .cpp files, what should I do with them?

1)As far as I understand, they need to be processed by the Cmake program and it seems that the output should appear .lib file, but I absolutely can’t understand how to do it or maybe something else 2)Or how can they be directly processed by Visual Studio 2017?

PS:When I launch Smack, I select the Source folder, the Cmake generates many incomprehensible files, but among them there is not one file with the .lib extension.

Help me please.

Upvotes: 1

Views: 2854

Answers (2)

Sergio
Sergio

Reputation: 941

With CMake you can obtain the visual studio 2017 project files and then compile the xlnt library.

  1. Unzip the archive file
  2. Within the xlnt folder, create a new directory and call it build
  3. Launche CMake (GUI)
  4. Browse for the source code folder
  5. Browse for the build folder xlnt/build
  6. With the Configure button select the tool (IDE/compiler) that you want to use
  7. Pressing the Generate button, CMake will generate (inside the build folder) the visual studio 2017 project files you need to compile the xlnt library
  8. Building the solution, VS 2017 produces the xlnt.lib, xlnt.exp and xlnt.dll files.

    CMake xlnt

Upvotes: 2

Sergio
Sergio

Reputation: 941

The source path you see in the CMake screenshot is incorrect.
You must specify the path that contains the "top level" CMakeLists.txt file. The correct directory is: C:/Users/Zver/source/repos/XLNT Library/xlnt-master.
The CMakeLists.txt file in the above directory tells CMake all necessary subdirectories. At this point you will see the static compilation option of the library appear.
If you use the MinGW/GCC compiler you must prevent the path from containing empty spaces. Then you need to rename the directory from "XLNT Library" to "XLNTLibrary".
At this point the path would become: C:/Users/Zver/source/repos/XLNTLibrary/xlnt-master.

Upvotes: 1

Related Questions