You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Encountered a terminating error outside of IDE (VSCode) that I can't seem to get around. I did this issue posted before back in 2017-2018, but none of the solutions or checks that were discussed solved this problem. The repository used is PUPPET on my Github page, in case you want to reproduce the error. The full error is provided below:
terminate called after throwing an instance of 'nlohmann::detail::parse_error'
what(): [json.expection.parse_error.101] parse error at line 1, column 1: syntax error while parsing value - unexpected end of input; expected '[', '{', or a literal
Reproduction steps
Strangely, it only occurs outside of the IDE, when calling the command json::parse(fstream ifs) or ifs >> json dict (the type is not called of course, it's just for reference). I don't think this is a bug with the library, but rather something I don't know when building it. I call the below build:
I apologize if my information is unclear or lacking, or if this isn't a bug at all. Thank you for looking into this!
Expected vs. actual results
The expected result should load up the game menu, and allow the user to start a new game, resume a previous, select options, or exit. In particular, selecting options should be able to access and change the value(s) of the options.json file, but instead the program runs into the error and shuts down immediately.
Minimal code example
#include "../.hpp/json.hpp"#include <fstream>
using namespace std;
using json = nlohmann::json;
int main() {
ifstream ifs("../.json/options.json");
json options = json::parse(ifs);return 0;
}
Error messages
terminate called after throwing an instance of 'nlohmann::detail::parse_error'what(): [json.expection.parse_error.101] parse error at line 1, column 1: syntax error while parsing value - unexpected end of input; expected '[', '{', or a literal
Compiler and operating system
mingw64, Windows 10
Library version
3.10.5
Validation
The bug also occurs if the latest version from the develop branch is used.
Can you please check if the working directory is properly set such that ../.json/options.json is an existing file? The error message indicates the file was not found. Maybe try an absolute path.
Ah thank you! It seems that VSCode's .exe launch.json started from the .cpp file level (${fileDurname}) and not from the working directory (${workspaceFolder}). This, in combination with using "../.json" instead of just ".json", caused a mismatch in where to look. Thanks again, no bug here at all!
Description
Encountered a terminating error outside of IDE (VSCode) that I can't seem to get around. I did this issue posted before back in 2017-2018, but none of the solutions or checks that were discussed solved this problem. The repository used is PUPPET on my Github page, in case you want to reproduce the error. The full error is provided below:
terminate called after throwing an instance of 'nlohmann::detail::parse_error'
what(): [json.expection.parse_error.101] parse error at line 1, column 1: syntax error while parsing value - unexpected end of input; expected '[', '{', or a literal
Reproduction steps
Strangely, it only occurs outside of the IDE, when calling the command
json::parse(fstream ifs)
orifs >> json dict
(the type is not called of course, it's just for reference). I don't think this is a bug with the library, but rather something I don't know when building it. I call the below build:C:\msys64\mingw64\bin\g++.exe -fdiagnostics-color=always -g E:\Users\buzze\Documents\GitHub\PUPPET\.cpp\*.cpp -o E:\User\buzze\Documents\Github\PUPPET\puppet.exe -static
.I apologize if my information is unclear or lacking, or if this isn't a bug at all. Thank you for looking into this!
Expected vs. actual results
The expected result should load up the game menu, and allow the user to start a new game, resume a previous, select options, or exit. In particular, selecting options should be able to access and change the value(s) of the options.json file, but instead the program runs into the error and shuts down immediately.
Minimal code example
Error messages
Compiler and operating system
mingw64, Windows 10
Library version
3.10.5
Validation
develop
branch is used.The text was updated successfully, but these errors were encountered: