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

Cannot debug but Run works #2085

Closed
hect1995 opened this issue May 3, 2020 · 2 comments
Closed

Cannot debug but Run works #2085

hect1995 opened this issue May 3, 2020 · 2 comments
Labels
kind: question state: needs more info the author of the issue needs to provide more details state: stale the issue has not been updated in a while and will be closed automatically soon unless it is updated

Comments

@hect1995
Copy link

hect1995 commented May 3, 2020

  • Describe what you want to achieve.
    I want to check which is the result of the json::parse of a certain file. Whenever I compile and run I see that works if I try to access one field. On the other hand if in debug mode, it crashes in:

Captura de pantalla 2020-05-03 a las 18 38 36

  • Describe what you tried.
    My simple script is:
#include "nlohmann/json.hpp"
#include <fstream>
#include <iostream>

using json = nlohmann::json;

int main()
{
    std::ifstream myinput("dataset/CTA_Bay17.json");
    auto j = json::parse(myinput);
    // write prettified JSON to another file
    std::cout << j["array"] << "\n";
}

And the JSON I am reading is:

{
    "array": [
        1,
        2,
        3
    ],
    "boolean": true,
    "color": "gold",
    "null": null,
    "number": 123,
    "object": {
        "a": "b",
        "c": "d"
    },
    "string": "Hello World"
}
  • Describe which system (OS, compiler) you are using. Mac OS Catalina and LLDB

  • Describe which version of the library you are using (release version, develop branch).
    Master branch

@nlohmann
Copy link
Owner

nlohmann commented May 3, 2020

What is the exact exception message? If I would need to guess, the file cannot be found, because your debugger may run in a different working directory. Can you double check the file can actually be opened?

@nlohmann nlohmann added the state: needs more info the author of the issue needs to provide more details label May 3, 2020
@stale
Copy link

stale bot commented Jun 2, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the state: stale the issue has not been updated in a while and will be closed automatically soon unless it is updated label Jun 2, 2020
@stale stale bot closed this as completed Jun 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: question state: needs more info the author of the issue needs to provide more details state: stale the issue has not been updated in a while and will be closed automatically soon unless it is updated
Projects
None yet
Development

No branches or pull requests

2 participants