0
我是新来的节目和我在之后的http://c.learncodethehardway.org/book/ex4.html教程这表明你如何安装的valgrind。我编译的例子程序,它应该显示内存泄漏的valgrind:工具“MEMCHECK”没有安装
#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;
}
但是当我键入
$ valgrind ./ex4
我得到的消息
valgrind: tool 'memcheck' not installed (/usr/local/lib/valgrind/memcheck-amd64-darwin) (No such file or directory)
当我在那个目录中查找有没有memcheck文件。安装程序没有工作?
“*安装程序没有工作?*”看起来像。 – alk
yep @alk是对的。删除了最新版本3.9.0,并从教程3.6.1安装了一个,memcheck工作正常。谢谢 –