I have not used valgrind before, but I need to use it to check memory leak. I ran the following command:
G_SLICE=always-malloc G_DEBUG=gc-friendly valgrind -v --tool=memcheck --leak-check=full --num-callers=40 --log-file=valgrind.log example1
valgrind: example1: command not found
I followed instructions from this site: http://www.cprogramming.com/debugging/valgrind.html
this is what the example1 file looks like:
#include <stdlib.h>
int main()
{
char *x = malloc(100); /* or, in C++, "char *x = new char[100] */
return 0;
}
I know valgrind is installed on my machine, regardless I ran the following command to make sure:
sudo apt-get install valgrind
Can somebody pls. guide me how to get valgrind working....thx!