0

I'm trying to debug my little program, but it's like it doesn't exist main.exe, but it exists.

enter image description here

My code is this simple:

enter image description here

And my launch.json is this one:

{
// 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": "cpp.exe - Compilar y depurar el archivo activo",
        "type": "cppdbg",
        "request": "launch",
        "program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
        "args": [],
        "stopAtEntry": true,
        "cwd": "C:\\Program Files\\mingw-w64\\x86_64-8.1.0-posix-seh-rt_v6-rev0\\mingw64\\bin",
        "environment": [],
        "externalConsole": false,
        "MIMode": "gdb",
        "miDebuggerPath": "C:\\Program Files\\mingw-w64\\x86_64-8.1.0-posix-seh-rt_v6-rev0\\mingw64\\bin\\gdb.exe",
        "setupCommands": [
            {
                "description": "Habilitar la impresión con sangría para gdb",
                "text": "-enable-pretty-printing",
                "ignoreFailures": true
            }
        ],
        "preLaunchTask": "C/C++: cpp.exe build active file"
    }
]

}

I don't know what it's wrong. Thank you.

My build output:

enter image description here

And my task.json is this one:

enter image description here

8
  • Not in executable format suggests the build is incorrect. You're producing something and calling it an exe, but it's not an exe, or at least isn't an exe when the debugger looks at it. Please add the build instruction that VS Code generates and the json file responsible for building. Commented Jan 13, 2021 at 20:37
  • 1
    I would never use a path that contains spaces or +. Not saying that is the issue here, but it's one more possible problem, and completely unnecessary. Commented Jan 13, 2021 at 21:25
  • Your first test would be to open a cmd.exe window and change directory to the location of the executable and see if you can run it from there. Commented Jan 13, 2021 at 22:51
  • @john I've changed my path to PruebaCPlusPlus and still there is the same error. Commented Jan 15, 2021 at 16:25
  • 1
    @user4581301 I've just changed the post, thank you. Anything you need to solve it. Commented Jan 15, 2021 at 16:31

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.