Visual Studio 2022/VSCode C++配置第三方库(libsndfile)

时间:2025-04-26 22:15:59
{ "version": "2.0.0", "tasks": [ { "type": "cppbuild", "label": "C/C++: 生成活动文件", "command": "W:/software/mingw64/bin/", "args": [ "-fdiagnostics-color=always", "-g", "${workspaceFolder}\\*.c", "-I","W:/software/fftw", "-L","W:/software/fftw", "-llibfftw3-3", "-llibfftw3f-3", "-llibfftw3l-3", "-I","W:/software/libsndfile/lib", "-L","W:/software/libsndfile/lib", "-llibsndfile-1", "-o", "${workspaceFolder}\\" ], "options": { "cwd": "W:/software/mingw64/bin" }, "problemMatcher": [ "$gcc" ], "group": "build", "detail": "编译器: W:/software/mingw64/bin/" }, { "type": "cppbuild", "label": "C/C++: g++.exe 生成活动文件", "command": "W:\\software\\mingw64\\bin\\g++.exe", "args": [ "-fdiagnostics-color=always", "-g", "${workspaceFolder}\\*.cpp", "-I","W:/software/libsndfile/include", // -I 是对应头文件的位置 "-L","W:/software/libsndfile/lib", // -L 是对应库文件lib的位置 "-llibsndfile-1", // -l(小写L) 文件名 "-I","W:/software/fftw", "-L","W:/software/fftw", "-llibfftw3-3", "-llibfftw3f-3", "-llibfftw3l-3", "-o", "${workspaceFolder}\\" ], "options": { "cwd": "${fileDirname}" }, "problemMatcher": [ "$gcc" ], "group": "build", "detail": "编译器: W:\\software\\mingw64\\bin\\g++.exe" } ] }