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

Eclipse: Method 'size' could not be resolved #649

Closed
k22jung opened this issue Jul 7, 2017 · 10 comments
Closed

Eclipse: Method 'size' could not be resolved #649

k22jung opened this issue Jul 7, 2017 · 10 comments

Comments

@k22jung
Copy link

k22jung commented Jul 7, 2017

I'm running Eclipse Oxygen on Linux and I followed all the instructions for Integration into my C++ project. When I try to call any function like j.size() or j.parse() on my json j; object, Eclipse keeps saying "Method 'function_name' could not be resolved" and it shows an error. Creating a json object and accessing its contents works perfectly fine, it's just size(). However it doesn't seem building with g++ causes any errors to occur. Are there any known issues with Eclipse and json.hpp? I'm using json v2.1.1.

@nlohmann
Copy link
Owner

nlohmann commented Jul 7, 2017

No, I have no heard about neither problems nor successes with the library and Eclipse. Maybe you need to set the language version to C++11?

And as a remark: parse is a static function.

@k22jung
Copy link
Author

k22jung commented Jul 7, 2017

I've followed the instructions on integration and I've added the argument for C++11, but it still does it. It's not a major issue, just wondering if it was possible to fix. I can close the issue if you are not aware of any fixes.

@nlohmann
Copy link
Owner

nlohmann commented Jul 7, 2017

This may be an issue in Eclipse's frontend, as you mentioned the code compiles without problems. I have little experience there.

@nlohmann
Copy link
Owner

nlohmann commented Jul 8, 2017

I cannot reproduce the issue. I downloaded Eclipse (Oxygen Release (4.7.0)), created a C++ hello world project and added file json.hpp. I also set the language dialect to C++11.

The size method is properly auto-completed:

eclipse

and also has no issues when written out:

eclipse2

I can compile without problems.

@nlohmann
Copy link
Owner

nlohmann commented Jul 8, 2017

Here the complete Window including build information.

eclipse

@nlohmann nlohmann added the state: please discuss please discuss the issue or vote for your favorite option label Jul 8, 2017
@k22jung
Copy link
Author

k22jung commented Jul 10, 2017

Are you using Ubuntu 16.04? Or is that Mac?

@nlohmann
Copy link
Owner

I'm using macOS Sierra.

@k22jung
Copy link
Author

k22jung commented Jul 11, 2017

Okay I tried doing what you did with a new project on Ubuntu. It seems I get the same result as you - no errors.

image

However, I have a second project that contains some cflags and libs for OpenCV, but I wouldn't think that would affect it.

image

Also, the only major difference is that the project in the second image is version controlled under Git. Other than that, everything remains the same. Maybe it'll be better if I ask Eclipse support what's up.

@k22jung
Copy link
Author

k22jung commented Jul 11, 2017

The kl_tracker project won't let me auto-complete any function related to json

@nlohmann
Copy link
Owner

This really sounds like an Eclipse issue.

@nlohmann nlohmann removed the state: please discuss please discuss the issue or vote for your favorite option label Jul 11, 2017
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

2 participants