"args": [
"-std=c99",
"-fdiagnostics-color=always",
"-g",
"${file}",
"-I","D:\\R2024b_Update_1_Windows\\extern\\include",
"-L\\D:\\R2024b_Update_1_Windows\\extern\\lib\\win64\\microsoft",
"-l mat",
"-l mx",
"-l mex",
"-l eng",
"-o","${fileDirname}\\${fileBasenameNoExtension}.exe"
],
这是在tasks.json的设置
Starting build...
cmd /c chcp 65001>nul && D:\Users\name\Downloads\x86_64-8.1.0-release-posix-seh-rt_v6-rev0\mingw64\bin\gcc.exe -std=c99 -fdiagnostics-color=always -g E:\c_code\mat_code\ex1307.c -I D:\R2024b_Update_1_Windows\extern\include -L\D:\R2024b_Update_1_Windows\extern\lib\win64\microsoft "-l mat" "-l mx" "-l mex" "-l eng" -o E:\c_code\mat_code\ex1307.exe
D:/Users/name/Downloads/x86_64-8.1.0-release-posix-seh-rt_v6-rev0/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -l mat
D:/Users/name/Downloads/x86_64-8.1.0-release-posix-seh-rt_v6-rev0/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -l mx
D:/Users/name/Downloads/x86_64-8.1.0-release-posix-seh-rt_v6-rev0/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -l mex
D:/Users/name/Downloads/x86_64-8.1.0-release-posix-seh-rt_v6-rev0/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -l eng
collect2.exe: error: ld returned 1 exit status
Build finished with error(s).
这是运行后terminal的显示信息
我将matlab库文件路径都添加到了系统环境变量
确认了路径正确,文件夹下有相应的lib文件
