Im facing a problem on using valgrind to check memory leaks in C. It tells me "valgrind: command not found. I'm using windows and I installed mingw. If any one can help me I'll be grateful.
Asked
Active
Viewed 1,709 times
1
-
1Welcome to SO. Kindly post the error message as text. I'd suggest using WSL instead. – Harith Feb 25 '23 at 17:15
-
It will be very hard as there is no valgrind for windows. – 0___________ Feb 25 '23 at 19:24
-
You may be better off loading VMWare and running a Linux VM. – dbush Feb 26 '23 at 21:13
1 Answers
4
Valgrind runs on Linux, FreeBSD, Solaris and macOS (and not so well for the last two).
In the past there have been unofficial forks and patches to run on Windows or with Wine. I've never used these so I can't comment on whether they still work. There hasn't been any activity for a long time to maintain them.
The problem is that Windows is very different. Valgrind needs to read ELF and DWARF (it can also read macho and PDB). It's based on unix mmap, syscalls, signals which makes porting to Windows virtually an entire rewrite.
As an alternative there is Dr Memory. That's not so low level as Valgrind and so it does run on Windows.

Paul Floyd
- 5,530
- 5
- 29
- 43