Skip to content

Can't read json file #1791

@AustinJia

Description

@AustinJia
  • Describe what you want to achieve.
    Read .json file as json object

  • Describe what you tried.
    downloaded the include/nlohmann folder in my local project's include folder
    Create a .json file in src
    std::ifstream i(path+"config.json", std::ifstream::binary);
    json j;
    i >> j;
    it always shows

[json.exception.parse_error.101] parse error at line 1, column 1: syntax error while parsing value - unexpected end of input; expected '[', '{', or a literal

  • Describe which system (OS, compiler) you are using.
    ubuntu 16.04 xenial

  • Describe which version of the library you are using (release version, develop branch).
    JSON for Modern c++ v3.7.0

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions