Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
2 of 4 tasks
Mecanik opened this issue Jun 4, 2020 · 1 comment
Closed
2 of 4 tasks

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

Mecanik opened this issue Jun 4, 2020 · 1 comment
Labels
kind: bug platform: visual studio related to MSVC solution: invalid the issue is not related to the library

Comments

@Mecanik
Copy link

Mecanik commented Jun 4, 2020

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).

@Mecanik
Copy link
Author

Mecanik commented Jun 4, 2020

Found the issue... it seems I am not allowed to have:

using namespace boost;
using namespace boost::posix_time;
using namespace boost::property_tree;

Amongst other namespaces... which I had to remove all of them.

Thanks anyway...

@Mecanik Mecanik closed this as completed Jun 4, 2020
@nlohmann nlohmann added platform: visual studio related to MSVC solution: invalid the issue is not related to the library labels Jun 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug platform: visual studio related to MSVC solution: invalid the issue is not related to the library
Projects
None yet
Development

No branches or pull requests

2 participants