How do I build and run C files that use math.h functions in VSCode?
问题 As mentioned here: Undefined reference to pow( ) in C, despite including math.h, I can build C files that use math.h functions in Linux Ubuntu only in the terminal, by putting -lm at the end of gcc -o namefile namefile.c . But I want to build and run a C code that uses math.h in VSCode specifically. How do I do that? 回答1: You can do the same in VS Code using a custom task configuration for compiling your .c file. Let's say we have this test.c file with math.h. #include <math.h> #include