Stiffstream / json_dto

A small header-only library for converting data between json representation and c++ structs
BSD 3-Clause "New" or "Revised" License
149 stars 18 forks source link

Tons of errors on windows #17

Closed ughstudios closed 1 year ago

ughstudios commented 2 years ago
1>D:\dev\vcpkg\installed\x64-windows\include\json_dto\pub.hpp(620,53): warning C4003: not enough arguments for function-like macro invocation 'max'
1>D:\dev\vcpkg\installed\x64-windows\include\json_dto\pub.hpp(620,53): error C2589: '(': illegal token on right side of '::'
1>D:\dev\vcpkg\installed\x64-windows\include\json_dto\pub.hpp(620): error C2062: type 'unknown-type' unexpected
1>D:\dev\vcpkg\installed\x64-windows\include\json_dto\pub.hpp(620,59): error C2059: syntax error: ')'
1>D:\dev\vcpkg\installed\x64-windows\include\json_dto\pub.hpp(622,2): error C2181: illegal else without matching if
1>D:\dev\vcpkg\installed\x64-windows\include\json_dto\pub.hpp(646,52): warning C4003: not enough arguments for function-like macro invocation 'max'
1>D:\dev\vcpkg\installed\x64-windows\include\json_dto\pub.hpp(647,49): warning C4003: not enough arguments for function-like macro invocation 'min'
1>D:\dev\vcpkg\installed\x64-windows\include\json_dto\pub.hpp(646,52): error C2589: '(': illegal token on right side of '::'
1>D:\dev\vcpkg\installed\x64-windows\include\json_dto\pub.hpp(646): error C2062: type 'unknown-type' unexpected
1>D:\dev\vcpkg\installed\x64-windows\include\json_dto\pub.hpp(647,49): error C2589: '(': illegal token on right side of '::'
1>D:\dev\vcpkg\installed\x64-windows\include\json_dto\pub.hpp(647,1): error C2059: syntax error: ')'
1>D:\dev\vcpkg\installed\x64-windows\include\json_dto\pub.hpp(647,55): error C2059: syntax error: ')'
1>D:\dev\vcpkg\installed\x64-windows\include\json_dto\pub.hpp(649,2): error C2181: illegal else without matching if
1>D:\dev\vcpkg\installed\x64-windows\include\json_dto\pub.hpp(682,93): warning C4003: not enough arguments for function-like macro invocation 'max'
1>D:\dev\vcpkg\installed\x64-windows\include\json_dto\pub.hpp(682,93): error C2589: '(': illegal token on right side of '::'
1>D:\dev\vcpkg\installed\x64-windows\include\json_dto\pub.hpp(682): error C2062: type 'unknown-type' unexpected
1>D:\dev\vcpkg\installed\x64-windows\include\json_dto\pub.hpp(682,93): error C2059: syntax error: ')'

The only thing I'm doing is this:

UserLogin login_info(username, password);
std::string json_data = json_dto::to_json<UserLogin>(login_info);
eao197 commented 2 years ago

Hi!

It seems it's closely related to macros min and max in windows.h https://stackoverflow.com/questions/13416418/define-nominmax-using-stdmin-max/13420838