[SOLVED!] How to fix Unverified Breakpoints

Hi @DanM,

Thank you! Everything is working now!
Debugging is still a problem, but I’ll wait to affront that issue again in the next project.

Thanks again for helping me because I certainly couldn’t have done it without you!

Thank you,
Enrico

Hi @DanM,

Actually I was too curious to see what would happen when I debug…
So I went back to the original project (which is now working by the way!) and pressed F5. Debugging seems to be working correctly after I changed to "externalConsole": to true.
What doesn’t seem to work is building. When I press “Ctrl+Shift+B” I get this in the console:


Is this occurring because I changed "externalConsole": to true? How can I fix it (that way I can return to my original project…)?

Thanks! :+1:
Enrico

What’s the problem with that output?

Hi @DanM,

I have two questions.

  1. When I booted up VS Code today directly from the desktop and tried compile it tells me that:
'cl.exe' is not recognized as an internal or external command,
operable program or batch file.

However, when I open Developer Command Prompt, type cl, and then type code to open VS Code, compiling works without a problem. I’m just wondering: from now on, do I have to go through dev prompt to open VS Code?

  1. I thought the below screenshot had a problem because then it doesn’t let me run my game. So, I’m just wondering after pressing “Ctrl+Shift+B” and after the terminal tells me this:
    fix1
    How can I then play my game?

Thanks,
Enrico

  1. Yes
  2. How are you trying to play it?

Hello @DanM,

I’m trying to play the game through the terminal like I used to be able to when typing cl main.cpp FBullCowGame.cpp and then typing main FBullCowGame to actually make the game run in the terminal where I can input words.
Here is a screenshot of what I used to be able to do:

Thanks,
Enrico

Refer back to this post [HELP] How to fix Unverified Breakpoints

And look at the output of compilation.

Hi @DanM,

I see. So I don’t have to type all of that stuff to get the program to compile, but I don’t understand what you mean by the “output of compilation.”
And I still don’t see how this brings me closer to being able to play the game.

Sorry for my ignorance again, :woozy_face:
Enrico

The screenshot you posted is you compiling and the output of which. Specifically though I’m referring to this line

/out:BCGame.exe

Hi @DanM,

Which screenshot are you referring to? This one?
What does that line have to do with this? Not that I’m doubting you, just that I don’t understand.

Thanks,
Enrico

That doesn’t have that line in it so no.
The one you just posted here

My point is that the program is not called either “main.exe” or “FBullCowGame.exe”

Hi @DanM,

I don’t think the link is working becuase each time I press it I get directed to this, Post #11 (which is your post). Are you talking about the screenshot in Post #49? If not, please give the post number instead of a link.

Ok, so your saying that the terminal should say something like

/out:main.exe

instead of

/out:BCGame.exe

How can I fix this? I’m using your launch.json and task.json files by the way.

Thanks,
Enrico

P.S. Just so you don’t have to scroll up and down every time to see the .json files here they are:
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": "Debug",
            "type": "cppvsdbg",
            "request": "launch",
            "program": "build/BCGame.exe",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": true,
            "preLaunchTask": "Build"
        }
    ]
}

tasks.json

{
    "version": "2.0.0",
    "tasks": [
        {
            "type": "shell",
            "label": "Build",
            "command": "cl.exe",
            "args": [
                "/Zi",
                "/EHsc",
                "/Fe:",
                "BCGame.exe",
                "${workspaceFolder}\\main.cpp",
                "${workspaceFolder}\\FBullCowGame.cpp"
            ],
            "options": {
                "cwd": "${workspaceFolder}/build"
            },
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "problemMatcher": [
                "$gcc"
            ]
        }
    ]
}

No. I’m saying the program you created is called “BCGame.exe” so “main.exe” or “FBullCowGame.exe” don’t exist. And if you refer back to that post I cited earlier in which I say how you run a program, you should understand what you’re trying to do by typing what you’re typing is incorrect.

BCGame

From the build directory is what you need to type because that’s the name of the program which is specified here

"/Fe:",
"BCGame.exe",

Hi @DanM,

Ok. Now I understand. I can’t run the program by typing cl main.cpp FBullCowGame.cpp and main anymore because those .exe files don’t exist.
Instead, I should only type BCGame.exe, right? The only problem is that the terminal closes when I try to type anything (or is that what’s supposed to happen)?

Thanks

Running the program and compiling the program are entirely different things. That command quoted above compiles the program with those two files. Since the output name wasn’t specified it will be named after the first file listed (main.exe)

That’s a terminal that was launched for the build task. Just launch via Debug > Start with(or without) Debugging

Hi @DanM,

Ohhhhh … I understand now. And sorry for me typing “run” I meant to say “compile.” So:
Theoretically, you could compile typing cl.... but you would need to put in /Fe:BCGame for it to compile correctly without creating a main.exe file, correct?


Question: When I compile should I first press “Ctrl+Shift+B” and then Debug > Start with/without Debugging? or can I directly press Start with/without Debugging?

Thank you so much! I better understand the way VS Code works so hopefully I will be able to fix my problems in the future (if not I’ll always have you…)

Thanks,
Enrico

P.S. Thanks for telling me about Start > Start with/without Debugging. That was the answer I was looking for all along!

What do you mean by “correctly”? You can call the executable anything you want, you would just have to modify the launch config accordingly specifically this line

"program": "build/BCGame.exe",

No you don’t have to compile before hand because the launch task builds before launching and this is what this line does

"preLaunchTask": "Build"

i.e. before launching execute the task with a label “Build”

1 Like

Hello @DanM,

Yeah, that what I meant to say.

Ok, that’s good news!

Thank you so much again! I think this saga is finally over!

Thanks you so so much!
Enrico

P.S. Thanks!!! You don’t know how much this has been bothering me but it’s finally over thanks to you! :wink:

1 Like

If you’re looking to solve unverified breakpoints:

If your cl.exe file isn’t working:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms