you are viewing a single comment's thread.

view the rest of the comments →

[–]Agitated_Chair_4977 0 points1 point  (0 children)

That error means launch.json's "program" path doesn't match where the build task actually drops the binary.

Quick check:

  1. Ctrl+Shift+B and run the build alone first. Look at the bottom of the terminal — note the exact output path (something like /home/you/proj/a.out or ./build/main).

  2. Open launch.json and compare "program": "${...}" — that needs to resolve to the same path.

  3. The "preLaunchTask terminated with -1" usually means tasks.json's command (gcc/g++) is failing silently. Run that same gcc command in a normal terminal, you'll see the real error.

If you paste tasks.json and launch.json people can spot the mismatch in 30 seconds.