Valgrind:致命错误:memcheck.h:没有那个文件或目录 [英] Valgrind: fatal error: memcheck.h: No such file or directory
问题描述
我们正试图在 Valgrind 报告的 C++ 项目中追踪条件跳转或移动取决于未初始化的值.发现中提供的地址并没有真正的帮助,因为它指向 GCC 扩展程序集块的末尾,而不是导致问题的实际变量.
We are trying to track down a Conditional jump or move depends on uninitialised value in a C++ project reported by Valgrind. The address provided in the finding is not really helpful because it points to the end of a GCC extended assembly block, and not the actual variable causing the trouble.
根据 Valgrind's 用 Valgrind 消除未定义的值,最简单的方法,我们可以在包含 后使用
.此外,这些宏或函数显然记录在头文件中(绝对没有针对它们的手册页).VALGRIND_CHECK_MEM_IS_DEFINED
或 VALGRIND_CHECK_VALUE_IS_DEFINED
According to the Valgrind's Eliminating undefined values with Valgrind, the easy way, we can use VALGRIND_CHECK_MEM_IS_DEFINED
or VALGRIND_CHECK_VALUE_IS_DEFINED
after including <memcheck.h>
. Additionally, those macros or functions are apparently documented in the header file (there is definitely no man page for them).
但是,当我包含
或
时,它会导致:
However, when I include <memcheck.h>
or <valgrind/memcheck.h>
, it results in:
致命错误:memcheck.h:没有那个文件或目录
fatal error: memcheck.h: No such file or directory
基于 Stack Overflow 的 如何找到哪个 rpm 包提供了我正在寻找的文件?,我执行了一个 RPM 文件搜索,但是它为 memcheck.h
返回 0 个命中.
Based on Stack Overflow's How do I find which rpm package supplies a file I'm looking for?, I performed a RPM file search, but its returning 0 hits for memcheck.h
.
问题
博客文章有点过时了.信息是否仍然适用?
The blog article is a bit dated. Does the information still apply?
如果信息准确,那么我在哪里可以找到memcheck.h
?
If the information is accurate, then where do I find memcheck.h
?
<小时>
$ uname -a
Linux localhost.localdomain 4.1.4-200.fc22.x86_64 #1 SMP Tue Aug 4 03:22:33 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
$ g++ --version
g++ (GCC) 5.1.1 20150618 (Red Hat 5.1.1-4)
...
$ valgrind --version
valgrind-3.10.1
推荐答案
您必须安装包含 memcheck.h
的 RPM valgrind-devel
.
You have to install the RPM valgrind-devel
which contains memcheck.h
.
*-devel
包通常位于可选"存储库中(例如 RHEL 6 上的 rhel-x86_64-server-optional-6
).此外,您可以在 Google 上找到 RPM,下载并自行安装.无论采用哪种方法,memcheck.h
通常在安装后放置在 /usr/include/valgrind
中.
The *-devel
packages are typically located in the "optional" repositories (e.g. rhel-x86_64-server-optional-6
on RHEL 6). Also, you can find the RPM on Google, download it, and install it on its own. With either approach, memcheck.h
is typically placed in /usr/include/valgrind
once installed.
这篇关于Valgrind:致命错误:memcheck.h:没有那个文件或目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!