- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用以下代码...
169: const char *title = Title.c_str();
170: glutCreateWindow(title);
... Valgrind 给了我以下...
==28841== Conditional jump or move depends on uninitialised value(s)
==28841== at 0x6FF7A4C: (within /usr/lib64/libGLcore.so.180.44)
==28841== by 0x6FF81F7: (within /usr/lib64/libGLcore.so.180.44)
==28841== by 0x7289B36: (within /usr/lib64/libGLcore.so.180.44)
==28841== by 0x728A757: _nv000133gl (in /usr/lib64/libGLcore.so.180.44)
==28841== by 0x4EAB9E9: (within /usr/lib64/libGL.so.180.44)
==28841== by 0x4EAEA81: (within /usr/lib64/libGL.so.180.44)
==28841== by 0x4EB1D81: (within /usr/lib64/libGL.so.180.44)
==28841== by 0x4EA782B: glXCreateNewContext (in /usr/lib64/libGL.so.180.44)
==28841== by 0x54DF9AA: fgOpenWindow (in /usr/lib64/libglut.so.3.8.0)
==28841== by 0x54DE062: fgCreateWindow (in /usr/lib64/libglut.so.3.8.0)
==28841== by 0x54DF300: glutCreateWindow (in /usr/lib64/libglut.so.3.8.0)
==28841== by 0x4146CE: vimrid::glut::GlutApplication::Init() (GlutApplication.cpp:170)
但是什么是未初始化的呢? title 变量用 Title.c_str() 的值初始化,Title 是在构造函数成员初始化列表中初始化的类成员...
class VimridApplication
{
// ...
public:
std::string Title;
// ...
}
VimridApplication::VimridApplication() :
Title("Untitled VimridApplication")
{
// ...
}
class GlutApplication : public VimridApplication
{
// ...
}
最佳答案
Valgrind 带有一些默认的错误抑制功能,但这可能不包括 libCLcore。
The error-checking tools detect numerous problems in the base libraries, such as the GNU C library, and the X11 client libraries, which come pre-installed on your GNU/Linux system. You can't easily fix these, but you don't want to see these errors (and yes, there are many!) So Valgrind reads a list of errors to suppress at startup. A default suppression file is created by the ./configure script when the system is built.
您可以创建自己的 error suppressions您知道与您的代码无关的内容。
关于c++ - 为什么 Valgrind 不喜欢我对 glutCreateWindow 的使用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/766303/
这是我的初始化代码: const int WIN_HEIGHT = 640; const int WIN_WIDTH = 640; void main(int argc, char **argv) {
我正在学习一个 openGL 教程,其中包括这个名为“glutCreateWindow”的函数,我的编译器(XCode 5 gcc,OSX)说它已被弃用。 还有什么选项适合替换这些“过剩*”相关函数?
我正在尝试在 python 中创建一个过剩的窗口并具有以下代码: glutInit() glutInitWindowSize(windowWidth, windowHeight) gl
我正在使用以下代码... 169: const char *title = Title.c_str(); 170: glutCreateWindow(title); ... Valgrind 给了我以
我是一名优秀的程序员,十分优秀!