I'm using WinLibs standalone build of GCC and MinGW-w64 for Windows.
When I add -fsanitize=address
compiler option, I get a linker error for asan
library.
Here is the command line which I'm using to compile my program:
g++ -fsanitize=address -g -Wall -Wextra -pedantic -std=c++20 .\test.cpp
And here is the error:
C:/sw/gcc-13.1.0/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lasan: No such file or directorycollect2.exe: error: ld returned 1 exit status
How can I resolve this linker error?