0

I've been writing c++ in vscode for two months now, and everything was working fine. Until last week this error showed up. (update: it showed up twice now) sometimes it's this error or a different error the program is the same as the one above^^ I was just trying to run the same program in a different file, and then a different error shows

{
// 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}\\${fileBasenameNoExtension}.exe",
        "args": [],
        "stopAtEntry": false,
        "cwd": "C:\\msys64\\mingw64\\bin",
        "environment": [],
        "externalConsole": false,
        "MIMode": "gdb",
        "miDebuggerPath": "C:\\msys64\\mingw64\\bin\\gdb.exe",
        "setupCommands": [
            {
                "description": "Enable pretty-printing for gdb",
                "text": "-enable-pretty-printing",
                "ignoreFailures": true
            },
            {
                "description":  "Set Disassembly Flavor to Intel",
                "text": "-gdb-set disassembly-flavor intel",
                "ignoreFailures": true
            }
        ]
    }
]

}

launch.json

This program is for usaco bronze contest, and the same file runs find when I put it into the online grader. The whole situation is frustrating and I'm worried that the same error will show up again during future contests :(

Please help, any suggestions are appreciated. Thanks!

A few things I've tried:

  • rename the file -> doesn't run
  • copying the same program to a different file -> doesn't run
  • using the same file but with a simple hello world -> runs
  • writing a different code with the same function -> doesn't run??
  • Attempted to uninstall vscode, but somehow I cannot uninstall it
  • editing launch.json according to multiple solutions online, none of them worked
  • Today the same error happened to a different program, and I couldn't find any similarities between the two.

And all the other programs I wrote before & after this error showed up all work. It seemed like it is very specific to these problem I'm trying to solve.

hywl
  • 11
  • 1
  • If you are on Windows, why don't use Microsoft Visual Studio 2022 Community? All these issues would go away. – 273K Jan 07 '23 at 06:58
  • https://stackoverflow.com/questions/41103612/vscode-compile-c-on-windows-the-exe-not-found – dorKKnight Jan 07 '23 at 07:08
  • @dorKKnight I tried this solution and it worked for 5-10 runs. But then the error appeared again. – hywl Jan 07 '23 at 19:04
  • @273K it is a whole other set of configurations that I have to figure out and customize. It would be preferred if I can stick with visual studio code. – hywl Jan 07 '23 at 19:05
  • You don't need to configure VS2022, just install it with the desktop development option enabled and you get it ready to work. – 273K Jan 07 '23 at 19:07
  • @273K I installed it today and it's nice to use. Thanks! Now at least I have another option when vscode breaks down. – hywl Jan 09 '23 at 02:10

0 Answers0