gpt4 book ai didi

c++ atioglxx.pdb 包含查找模块 atioglxx.dll 源代码所需的调试信息

转载 作者:行者123 更新时间:2023-11-30 03:17:36 45 4
gpt4 key购买 nike

我不断得到

atioglxx.pdb not loaded error

抛出的异常是

Unhandled exception at 0x61DA5D3A (atioglxx.dll) in opengl_fps.exe: 0xC0000005: Access violation writing location 0x00000000. occurred

这是在我添加了一些用于加载一些着色器和绘制三角形的代码之后开始发生的

我已经尝试过更新我的 amd 驱动程序,清理解决方案并重建,重新启动 visual studio,重新启动我的电脑,然后用谷歌搜索

加载着色器的代码

GLuint vsid = glCreateShader(GL_VERTEX_SHADER);\\exception thrown here
glShaderSource(vsid, 1, &vs, NULL);
glCompileShader(vsid);

GLint* success = 0;
GLchar infolog[512];

glGetShaderiv(vsid, GL_COMPILE_STATUS, success);
if (!success)
{
glGetShaderInfoLog(vsid, 512, NULL, infolog);
std::cout << "shader vs cant compile\n" << infolog << std::endl;
}
GLuint fsid = glCreateShader(GL_FRAGMENT_SHADER);
glShaderSource(fsid, 1, &fs, NULL);
glCompileShader(fsid);

glGetShaderiv(fsid, GL_COMPILE_STATUS, success);

if (!success)
{
glGetShaderInfoLog(vsid, 512, NULL, infolog);
std::cout << "shader fs cant compile\n" << infolog << std::endl;
}
GLuint shaderprogram = glCreateProgram();
glAttachShader(shaderprogram, vsid);
glAttachShader(shaderprogram, fsid);
glLinkProgram(shaderprogram);

glGetProgramiv(shaderprogram, GL_LINK_STATUS, success);

if (!success)
{
glGetShaderInfoLog(shaderprogram, 512, NULL, infolog);
std::cout << "shader program" << infolog;
}
glDeleteShader(vsid);
glDeleteShader(fsid);
GLfloat vertices[] = {
-0.5f,-0.5f,0.0f,
0.5f,-0.5f,0.0f,
0.0f,0.5f,0.0f
};

GLuint vbo, vao;
glGenVertexArrays(1, &vao);
glGenBuffers(1, &vbo);

glBindBuffer(GL_ARRAY_BUFFER, vbo);
glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW);

glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 3 * sizeof(GL_FLOAT), (GLvoid*)0);
glEnableVertexAttribArray(0);

glBindBuffer(GL_ARRAY_BUFFER, 0);
glBindVertexArray(0);

渲染代码

win.update();
glUseProgram(shaderprogram);
glBindVertexArray(vao);
glDrawArrays(GL_TRIANGLES, 0, 3);
glBindVertexArray(0);
win.swapbuffers();

最佳答案

glGetShaderiv 的第 3 个参数需要 GLint 的地址,您将空指针作为要使用的地址传入。

改变:

GLint* success = 0;
GLchar infolog[512];

glGetShaderiv(vsid, GL_COMPILE_STATUS, success);

收件人:

GLint success = 0;
GLchar infolog[512];

glGetShaderiv(vsid, GL_COMPILE_STATUS, &success);

还有其他类似的地方。

关于c++ atioglxx.pdb 包含查找模块 atioglxx.dll 源代码所需的调试信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55348538/

45 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com