Skip to content

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

Closed

Description

@k22jung

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.

Activity

  1. nlohmann commented on Jul 7, 2017

    @nlohmann
    Owner

    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.

  2. k22jung commented on Jul 7, 2017

    @k22jung
    Author

    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.

  3. nlohmann commented on Jul 7, 2017

    @nlohmann
    Owner

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

  4. nlohmann commented on Jul 8, 2017

    @nlohmann
    Owner

    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.

  5. nlohmann commented on Jul 8, 2017

    @nlohmann
    Owner

    Here the complete Window including build information.

    eclipse

  6. k22jung commented on Jul 10, 2017

    @k22jung
    Author

    Are you using Ubuntu 16.04? Or is that Mac?

  7. nlohmann commented on Jul 10, 2017

    @nlohmann
    Owner

    I'm using macOS Sierra.

  8. k22jung commented on Jul 11, 2017

    @k22jung
    Author

    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.

  9. k22jung commented on Jul 11, 2017

    @k22jung
    Author

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

  10. nlohmann commented on Jul 11, 2017

    @nlohmann
    Owner

    This really sounds like an Eclipse issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions