方法1 g++ -g *.cpp -o h.exe 方法2: tasks.json文件的args中,{file}改为{fileDirname}\\*.cpp 参考 VSCode C++多文件编译(最简单的方法)