在 Windows 7 上获取 Valgrind

Getting Valgrind on Windows 7

我正在学习 C 并且想在我的系统上安装 Valgrind,但是当我尝试安装 Valgrin 时我收到一条错误消息说 Valgrind is OS specific. Sorry 我正在 运行ning Windows 7,安装了 Mingw64 GIT。我做了一些研究,发现 this。据此,我需要 运行 sh ./configure --host x86_64 w64-mingw32 但是当我 运行 时,我得到以下输出:

$ sh ./configure --host x86_64-w64-mingw32
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for x86_64-w64-mingw64-strip... no
checking for strip... strip
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether ln -s works... no, using cp -pR
checking for x86_64-w64-mingw64-gcc... no
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking for x86_64-w64-mingw64-g++... no
checking for x86_64-w64-mingw64-c++... no
checking for x86_64-w64-mingw64-gpp... no
checking for x86_64-w64-mingw64-aCC... no
checking for x86_64-w64-mingw64-CC... no
checking for x86_64-w64-mingw64-cxx... no
checking for x86_64-w64-mingw64-cc++... no
checking for x86_64-w64-mingw64-cl.exe... no
checking for x86_64-w64-mingw64-FCC... no
checking for x86_64-w64-mingw64-KCC... no
checking for x86_64-w64-mingw64-RCC... no
checking for x86_64-w64-mingw64-xlC_r... no
checking for x86_64-w64-mingw64-xlC... no
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking for x86_64-w64-mingw64-ranlib... no
checking for ranlib... ranlib
checking for a sed that does not truncate output... /usr/bin/sed
checking for ar... /c/mingw/bin/ar
checking for perl... /usr/bin/perl
checking for gdb... /c/mingw/bin/gdb
checking dependency style of gcc... gcc3
checking for diff -u... yes
checking for a supported version of gcc... ok (4.7.2)
checking build system type... x86_64-pc-mingw64
checking host system type... x86_64-w64-mingw64
checking for a supported CPU... ok (x86_64)
checking for a 64-bit only build... no
checking for a 32-bit only build... no
checking for a supported OS... no (mingw64)
configure: error: Valgrind is operating system specific. Sorry.

所以我想,好吧,我有 Mingw64,所以我可以尝试一下,同样的事情。为什么会抛出我没有 Mingw 的异常,我该如何解决?

错误是说你的 OS 不受支持,它发现你的系统上的 Mingw 不受支持。

通常 Windows 不支持 valgrind。 Microsoft 有自己的 glibc 版本和自己的内核。制作一个可以 运行 on Windows 的 valgrind 版本需要大量的移植工作,目前没有人愿意做。

Valgrind 编译仅为:{x86,amd64,arm32,arm64,ppc32,ppc64le,ppc64be,s390x,mips32,mips64}-linux, {arm32 ,arm64,x86,mips32}-android, {x86,amd64}-solaris 和 {x86,amd64}-达尔文 (Mac OS X 10.13

是否有一个很好的 Valgrind 替代 Windows? Read more this

您可以尝试使用 MinGW 下载 Code::Blocks IDE Windows7 32/64 位

Official site here