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

error: ‘BasicJsonType’ in namespace ‘::’ does not name a type #770

Closed
pdroalves opened this issue Oct 6, 2017 · 5 comments
Closed

Comments

@pdroalves
Copy link

pdroalves commented Oct 6, 2017

I'm using g++ 5.4.0 and nvcc 8.0.44 to compile the most recent commit of the library. I compiled, installed the library, and included in my code (with C++11 flag) but when I try to compile my code I get:

/usr/local/include/nlohmann/json.hpp:3624:10: error: ‘BasicJsonType’ in namespace ‘::’ does not name a type

What am I missing?

@theodelrieu
Copy link
Contributor

Seems to be this line: friend BasicJsonType;

This is weird, the "simple-type-specifier" works since C++11, do you have a more recent GCC version to try?

You could also take the latest release, it should work fine.

@pdroalves
Copy link
Author

I don't think the problem lies in the GCC version. The library passed on all tests.
Maybe on nvcc?

@pdroalves
Copy link
Author

I think I solved it. I was running the last commit. Changed to v2.1.1 and it worked.

@yhtang
Copy link

yhtang commented Oct 19, 2018

Just some information for people running into the situation lately:

The problem showed up again with v3.1.2 when compiling with nvcc 9. Upgrading to CUDA 10 will automatically solve it. Apparently this is an issue of the nvcc compiler.

@babaozhouy5
Copy link

This answer can solve the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants