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

almagosi
  • 1
  • 2
  • 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. – user4581301 Jan 13 '21 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. – john Jan 13 '21 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. – drescherjm Jan 13 '21 at 22:51
  • @john I've changed my path to PruebaCPlusPlus and still there is the same error. – almagosi Jan 15 '21 at 16:25
  • @drescherjm Sorry, I don't know how to change that directory ^^'. Could you explain it? – almagosi Jan 15 '21 at 16:30
  • @user4581301 I've just changed the post, thank you. Anything you need to solve it. – almagosi Jan 15 '21 at 16:31
  • the command in cmd.exe to change the current directory is `cd`. This should help: [https://stackoverflow.com/questions/17753986/how-to-change-directory-using-windows-command-line](https://stackoverflow.com/questions/17753986/how-to-change-directory-using-windows-command-line) – drescherjm Jan 15 '21 at 16:49
  • For build information there's got to be more than that. See what's in the Output tab. – user4581301 Jan 15 '21 at 18:06

0 Answers0