Skip to content

Cannot build with VS 2019 / C++17 #2163

Closed
@Mecanik

Description

What is the issue you have?

I'v trying desperately to add this to my project so I can read some complex JSON, however I can't even compile it... not even to get to the part where I write a line of it.

I have tried both the latest release, current branch, as well as single include / normal include. Nothing works, and I`m not sure why I have this problem.

image

1>C:\...\include\nlohmann\json.hpp(8622,1): error C2062: type 'unknown-type' unexpected
1>C:\...\include\nlohmann\json.hpp(8623,1): error C3536: 'h': cannot be used before it is initialized
1>C:\...\include\nlohmann\json.hpp(8623,16): error C2064: term does not evaluate to a function taking 1 arguments

Please describe the steps to reproduce the issue.

  1. Create console project, set debug mode, x64
  2. Set ISO C++17 Standard (std:c++17), /MT
  3. Try to compile

Can you provide a small but working code example?

What is the expected behavior?

And what is the actual behavior instead?

Which compiler and operating system are you using?

  • Compiler: Microsoft Visual C++ 2019
  • Operating system: Windows 10

Which version of the library did you use?

  • latest release version 3.7.3
  • other release - please state the version: ___
  • [x ] the develop branch

If you experience a compilation error: can you compile and run the unit tests?

  • yes
  • no - please copy/paste the error message below

PS: I believe the message "please copy/paste the error message below" should be added next to the "yes" and not "no" ? Because if "no" = I don't have compilation error.

PPS: There is a DOZEN of examples, which is great! However there is no "simple" example for newcomers, for example a simple array loop, object, etc. Or maybe I am just not seeing it (due to the HUGE ReadMe file).

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions