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

Using JSON.hpp header file in Visual Studio 2013 (C++ Project) #2775

Closed
BaseMax opened this issue May 16, 2021 · 2 comments
Closed

Using JSON.hpp header file in Visual Studio 2013 (C++ Project) #2775

BaseMax opened this issue May 16, 2021 · 2 comments
Labels
solution: invalid the issue is not related to the library

Comments

@BaseMax
Copy link

BaseMax commented May 16, 2021

My main CPP file:

#include "json.hpp"
using json = nlohmann::json;

....
json obj = json::parse(s);
cout << "consoleToken:" << obj["consoleToken"] << endl;
....

What is the issue you have?

I want to use JSON header in a CPP project at VS.
So many errors....


Error	2	error C3646: 'noexcept' : unknown override specifier	c:\users\max\desktop\test\test\json.hpp	146	1	test
Error	3	error C2143: syntax error : missing ';' before 'std::array<uint8_t,0x09>'	c:\users\max\desktop\test\test\json.hpp	147	1	test
Error	4	error C4430: missing type specifier - int assumed. Note: C++ does not support default-int	c:\users\max\desktop\test\test\json.hpp	147	1	test
Error	5	error C2143: syntax error : missing ';' before 'user-defined conversion'	c:\users\max\desktop\test\test\json.hpp	2595	1	test
Error	6	error C4430: missing type specifier - int assumed. Note: C++ does not support default-int	c:\users\max\desktop\test\test\json.hpp	2595	1	test
Error	7	error C3646: 'noexcept' : unknown override specifier	c:\users\max\desktop\test\test\json.hpp	2647	1	test
Error	8	error C2143: syntax error : missing ';' before 'size_t'	c:\users\max\desktop\test\test\json.hpp	3079	1	test
Error	9	error C4430: missing type specifier - int assumed. Note: C++ does not support default-int	c:\users\max\desktop\test\test\json.hpp	3079	1	test
Error	10	error C3646: 'noexcept' : unknown override specifier	c:\users\max\desktop\test\test\json.hpp	3080	1	test
Error	11	error C1903: unable to recover from previous error(s); stopping compilation	c:\users\max\desktop\test\test\json.hpp	3137	1	test
	12	IntelliSense: a constexpr member function is only permitted in a literal class type	c:\Users\max\Desktop\test\test\json.hpp	11186	30	test
	13	IntelliSense: inline specifier allowed on function declarations only	c:\Users\max\Desktop\test\test\json.hpp	25935	1	test
	14	IntelliSense: expected an operator	c:\Users\max\Desktop\test\test\json.hpp	25935	32	test

photo_2021-05-17_01-04-51

Which version of the library did you use?

latest from the link.

photo_2021-05-17_01-04-56

@BaseMax
Copy link
Author

BaseMax commented May 16, 2021

I have to upgrade/update my VS and install a newer version? or there is another solutions? https://github.com/nlohmann/json#supported-compilers

@nlohmann nlohmann added solution: invalid the issue is not related to the library and removed kind: bug labels May 16, 2021
@nlohmann
Copy link
Owner

Yes, please use a supported compiler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
solution: invalid the issue is not related to the library
Projects
None yet
Development

No branches or pull requests

2 participants