I've debugged it many times and there was no problem.I don't know why there's this problem now.
Asked
Active
Viewed 38 times
0
-
It does not exist because the build failed because of the linker error. – drescherjm Nov 05 '21 at 21:39
-
Your error seems to be this: [https://stackoverflow.com/questions/10409032/why-am-i-getting-undefined-reference-to-sqrt-error-even-though-i-include-math](https://stackoverflow.com/questions/10409032/why-am-i-getting-undefined-reference-to-sqrt-error-even-though-i-include-math) – drescherjm Nov 05 '21 at 21:40
-
Check your `tasks.json` – drescherjm Nov 05 '21 at 21:43
-
I just pressed F5 to debug . I saw that answer and he compiled with gcc test.c -o test -lm ,how do I debug this in vscode?What step should I do before press F5? – Pikachy Nov 05 '21 at 23:13
-
Make sure your build task in tasks.json uses the correct libraries. – drescherjm Nov 05 '21 at 23:34
-
"args": [ "-fdiagnostics-color=always", "-g", "${file}", "-o", "${fileDirname}/${fileBasenameNoExtension}" ], should I add "-lm" here? – Pikachy Nov 06 '21 at 02:12
-
Yes add it as an argument. – drescherjm Nov 06 '21 at 02:27
-
Solved,thank you very much – Pikachy Nov 06 '21 at 14:00