最近在使用valgrind时,前一天还很正常,第二天突然在执行时出现如下问题:
valgrind: failed to start tool 'memcheck' for platform 'amd64-linux': No such file or directory
各个现有的解决方案都用过了,但是仍然不起作用。
猜想可能是高版本导致的问题:
这里的解决方案是:
确定你的valgrind
安装路径,如果安装时默认在解压缩包后直接执行./configure
,那么这里默认将每个模块安装到/usr/local
下
/usr/local/bin valgrind相关可执行程序
/usr/local/include/valgrind
/usr/local/lib/valgrind
/usr/local/libexec/valgrind
在~/.bashrc
中添加:
export VALGRIND_LIB=/usr/local/libexec/valgrind
然后执行source ~/.bashrc
即可
执行valgrind --version
可以查看到valgrind版本即成功!