troldal / OpenXLSX

A C++ library for reading, writing, creating and modifying Microsoft Excel® (.xlsx) files.
BSD 3-Clause "New" or "Revised" License
1.34k stars 317 forks source link

Numeric_limits causes compilation error on Windows due to a macro defined in Windows.h #260

Closed easymoney322 closed 3 weeks ago

easymoney322 commented 3 weeks ago

This line https://github.com/troldal/OpenXLSX/blob/d1896fb9ef707e390873c38d015246e8af80d088/OpenXLSX/headers/XLSharedStrings.hpp#L64 causes the error Error C2589: '(' : illegal token on right side of '::' if the Windows.h is included.

It's a known problem. I suggest wrapping it arround with parentheses, which resolves the problem. The other option is using #undef.

aral-matrix commented 3 weeks ago

Oh wow - that's a bad messup on windows side. I wouldn't have guessed this. Thank you very much - I'll fix it ASAP. Next answer in your pull request.