使用 VS Code 在 Windows 上设置 `regex.h` 库

Setting up the `regex.h` library on Windows with VS Code

我一整天都在尝试让 regex.h 库正常工作,但没有用。 (这是我的 VS Code 工作区配置:https://github.com/EnderCommunity/Murmur/tree/main/.vscode - 所有编译器信息都在这里)

这是我试图让正则表达式库使用的文件: https://github.com/EnderCommunity/Murmur/blob/main/compiler/libraries/regex/reg.h

我试图正常包含库,但是 returns 出现错误:

并且我尝试包含 this library,但它 returns 一些编译错误:

> Executing task: C/C++: gcc.exe build active file <

Starting build...
"C:\Program Files\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin\gcc.exe" -g C:\Users\adels\Desktop\EnderCommunity\Projects\Murmur\compiler\start.c -o C:\Users\adels\Desktop\EnderCommunity\Projects\Murmur\compiler\start.exe
C:\Users\adels\AppData\Local\Temp\ccifSq1r.o: In function `regChk':
C:/Users/adels/Desktop/EnderCommunity/Projects/Murmur/compiler/libraries/regex/reg.h:15: undefined reference to `__imp_regcomp'
C:/Users/adels/Desktop/EnderCommunity/Projects/Murmur/compiler/libraries/regex/reg.h:22: undefined reference to `__imp_regexec'
C:/Users/adels/Desktop/EnderCommunity/Projects/Murmur/compiler/libraries/regex/reg.h:33: undefined reference to `__imp_regerror'
C:/Users/adels/Desktop/EnderCommunity/Projects/Murmur/compiler/libraries/regex/reg.h:40: undefined reference to `__imp_regfree'
collect2.exe: error: ld returned 1 exit status

Build finished with error(s).
The terminal process terminated with exit code: -1.

Terminal will be reused by tasks, press any key to close it.

所以我包含这个库的方式可能是错误的!我在这里做错了什么?

使用 MSYS2 可以解决这个问题,它带有 C 的所有必要库。