0

It's my first time using an external library in my project, I am using OpenXLSX library for reading XLSX files.

I followed the procedure given in their official git repo: First I had to clone repo, then build the code with the help of CMake, and then install that library.

After that I had to include it's path into my project properties, and into linker as well.

Then after everything is done, I am running the demo example given inside the library itself, but it's giving numerous errors (125+) ,mostly of them turns out to be indicating that the syntax inside the library files is wrong ! Here is some example of the errors coming:

C:\Work\C++\tryingOpenXLSX1\include\OpenXLSX\headers\XLCellValue.hpp(112,74): error C2039: 'string_view': is not a member of 'std'

C:\Work\C++\tryingOpenXLSX1\include\OpenXLSX\headers\XLCellValue.hpp(199,74): error C2039: 'string_view': is not a member of 'std'

C:\Work\C++\tryingOpenXLSX1\include\OpenXLSX\headers\XLCellValue.hpp(150,21): error C3861: 'm_value': identifier not found

These are just few examples, I am getting errors out of library's files.

Now, I am not sure why this is happening, repo is cloned from latest version, my IDE (VS 2022) etc everything is updated.

phd
  • 82,685
  • 13
  • 120
  • 165
  • 3
    `C2039: 'string_view': is not a member of 'std'` -- Did you set the Language in your project settings to C++17? By default VS has the language set to C++14, which does not recognize `std::string_view`. [Possible duplicate](/questions/64042721/std-has-no-member-filesystem-in-c-17) – PaulMcKenzie Feb 28 '23 at 09:33
  • thanks for pointing it out, and it was indeed set default to C++ 14, However after changing that it's again errors which are of different nature this time : 1>OpenXLSX.lib(XLCellValue.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in Source.obj – Akash Rajawat Feb 28 '23 at 10:55
  • 1
    This might help for the new error: https://stackoverflow.com/questions/7668200/error-lnk2038-mismatch-detected-for-iterator-debug-level-value-0-doesnt. – wohlstad Feb 28 '23 at 11:01

1 Answers1

0

So, basically what was happening :

I was following the instructions given on official github repository, which were intended to build that library in 'Release' configuration, so when my IDE was debugging it, it was throwing errors.

Solution to it is:

Build library with specifying configuration to 'Debug' (using CMake ofcourse) and then also install it in 'Debug' configuration.