0

I start the debugger on Vs Code but i get the error : "The preLaunchTask 'C/C++: gcc-9 build active file' terminated with exit code -1."

So, I tried to debug a C program, but when I hit run and debug button, I receive the error: error screenShot. Someone knows how to solve that?

  • I think the important part of that message "build active file terminated..." This looks to me like the source code couldn't be built, that there's an error when building the program. What happens if you try to just plain *build* your program? If you look at the full and complete build log, do you get any errors? – Some programmer dude Nov 18 '22 at 08:11

1 Answers1

0

Maybe this is a problem with the path folder, if any directory in the path has a space or a special charactere, the gbd may have problem to build the archive. If this is not the case, maybe the debugger is expecting you to inform the flags to the tasks, you can do it, in the tasks.json in the .vscode folder, in the arguments part. For exemple, if you are using math.h and lpthread.h you must have something like that in the args: "args": [ "-fdiagnostics-color=always", "-g", "${file}", "-o", "${fileDirname}/${fileBasenameNoExtension}", "-lm", "-lpthread" ],