flanglet / kanzi-cpp

Fast lossless data compression in C++
Apache License 2.0
137 stars 3 forks source link

i can't build binary in MSVC2022 #13

Closed check4game closed 1 year ago

check4game commented 1 year ago

Hi

62 errors in project `libapi.cpp

C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\utility(655,42): error C2440: '=': cannot convert from '_Other' to '_Ty' with [ _Other=int ] and [ _Ty=std::_Iterator_base12 ] C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\utility(655,42): error C2440: '=': cannot convert from '_Other' to '_Ty' with [ _Other=int ] and [ _Ty=std::_Container_proxy ] `

please help, Thanks

flanglet commented 1 year ago

Hi, I need more information to help you: what version of C++ are you targeting ? Is it C++ 20 ? Did you get the VS solution from a release or the latest github ? Can you copy the complete log (the error you copied is not in Kanzi code).

check4game commented 1 year ago

Hi,

i get code vi download ZIP ISO C++14 Standard (/std:c++14) by default

I did some research and found out what the problem is.

https://github.com/flanglet/kanzi-cpp/blob/6dda5b52b8c0a6f9643e3f87dde5557d55b50031/src/types.hpp#L172

fix is...

` #if !defined(_MSC_VER) || _MSC_VER < 1920

define nullptr NULL

   #endif

`

1>Kanzi.vcxproj -> Z:\test\kanzi-cpp-master\x64\Release\Kanzi64.exe ========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ========== ========== Build started at 8:29 PM and took 26,991 seconds ==========

flanglet commented 1 year ago

Thanks for the update. Incindentally, since my version of MSVC is VS2017, my MSC_VER is 1910 and I do not see the error. Newer MSVS versions must have the definition added. I will patch the code.

check4game commented 1 year ago

Thanks