Skip to content

VC++2017 not enough actual parameters for macro 'max' #522

Description

@pavel-pimenov

VC++2017

default

Activity

  1. nlohmann commented on Mar 18, 2017

    @nlohmann
    Owner

    This seems to be related to #506. Please check the develop version where we added parentheses around the min/max calls to fix this MSVC error.

    (Note that the develop branch is unreleased and subject to change until version 3.0.0)

  2. BigJim commented on May 12, 2020

    @BigJim

    For the record I had the same problem in two places.

    The problem was not at all the json header code, but other header files defining things that conflict with STD, STL, defaults.

    My project has a couple of large dependencies with a lot of header files.
    I only have #include "json.hpp" in one place. I just had to add two "#undef xxx" statements just before it. Where "xxx" where the name of the conflicting defines done elsewhere before "json.hpp".
    In Visual Studio highlight the problem define and press F12 (the default jump to definition key) so you can see where the problem originated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions