I'm new to programming and am following the tutorials at http://c.learncodethehardway.org/book/ex4.html which shows you how to install valgrind. I've compiled the example program which should show memory leaks
#include <stdio.h>
/* Warning: This program is wrong on purpose. */
int main()
{
int age = 10;
int height;
printf("I am %d years old.\n");
printf("I am %d inches tall.\n", height);
return 0;
}
but when i type
$ valgrind ./ex4
i get the message
valgrind: tool 'memcheck' not installed (/usr/local/lib/valgrind/memcheck-amd64-darwin) (No such file or directory)
When i look in that directory there is no memcheck file. Has the installer not worked?
" Has the installer not worked? " looks like. – alk
yep @alk was right. removed the latest version 3.9.0 and installed the one from the tutorial 3.6.1 and memcheck works correctly. thanks – j_hindsight
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.