How to result Unable to open 'strtol_l.c' when debugging in VSCode

Viewed 530

I'm trying to debug a simple Cpp program that reads an input file and make a graph from it. However, when trying to debug on VSCode, this error pops up:

Unable to open 'strtol_l.c': Unable to read file '/build/glibc-ZN95T4/glibc-2.31/stdlib/strtol_l.c' (Error: Unable to resolve non-existing file '/build/glibc-ZN95T4/glibc-2.31/stdlib/strtol_l.c').

Here is my program:

int main(int argc, char *argv[]) 
{
    unordered_map<int, vector<int>> graph;

    ifstream input("input1.txt");
    string row;
    while (getline(input,row)) {   >>> where the error is
        istringstream iss(row);
        int node1, node2;
        if (iss >> node1 >> node2) {
            graph[node1].push_back(node2);
            graph[node2].push_back(node1);
        }
    }
    input.close();
}

here is my launch.json:

    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "(gdb) Launch",
            "type": "cppdbg",
            "request": "launch",
            "program": "${workspaceFolder}/a.out",
            "args": ["input1.txt"],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": false,
            "MIMode": "gdb",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ]
        }
    ]
}

A picture of the error:

error

Any hint?

0 Answers
Related