在 Windows (MinGW) 的 Qt Creator 中使用地址清理器找不到 -lasan [英] Cannot find -lasan using address sanitizer in Qt Creator in Windows (MinGW)
问题描述
我正在尝试通过将 CONFIG += sanitizer sanitize_address
添加到我的 .pro
文件来在 Qt 中使用 gcc 地址清理器,但我得到了一个 错误:找不到-lasan
.
I'm trying to use the gcc address sanitizer in Qt by adding CONFIG += sanitizer sanitize_address
to my .pro
file but I'm getting an error: cannot find -lasan
.
我应该如何安装库?
我正在使用 Qt 提供的 MinGW,但我也可以尝试独立版本.
I'm using the MinGW provided by Qt but I could also try a standalone version.
相关问题:MinGW-w64 的 gcc 和 Address Sanitizer
推荐答案
遗憾的是 GCC 在 Windows 上不支持 Asan:这里是 libsanitizer/configure.tgt:
Unfortunately GCC does not support Asan on Windows: here's an excerpt from libsanitizer/configure.tgt:
case "${target}" in
x86_64-*-linux* | i?86-*-linux*)
...
powerpc*-*-linux*)
...
sparc*-*-linux*)
...
s390*-*-linux*)
...
sparc*-*-solaris2.11*)
...
arm*-*-linux*)
...
mips*64*-*-linux*)
...
mips*-*-linux*)
...
aarch64*-*-linux*)
...
x86_64-*-darwin[1]* | i?86-*-darwin[1]*)
...
x86_64-*-solaris2.11* | i?86-*-solaris2.11*)
...
*)
UNSUPPORTED=1
;;
esac
请注意,Clang 支持它(需要付出一些努力 - 有关详细信息,请参阅 wiki)并且很多人都成功地使用了它.
Note that Clang supports it (with some effort - see wiki for details) and many people have successfully used it.
这篇关于在 Windows (MinGW) 的 Qt Creator 中使用地址清理器找不到 -lasan的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!