GLSL linker info log garbled

Started by
-1 comments, last by Geoff the Medio 15 years, 3 months ago
I'm testing out OpenGL shader programming, and am having trouble linking my shader program. I'm using this code:
        GLuint fragment_shader = glCreateShaderObjectARB(GL_FRAGMENT_SHADER_ARB);

        const char* shader_string =
            "void main() {"
            "    gl_FragColor = vec4(0.4, 0.4, 0.8, 1.0);"
            "}";

        glShaderSourceARB(fragment_shader, 1, &shader_string, NULL);
        glCompileShader(fragment_shader);

        GLint fragment_shader_compiled = 0;
        glGetObjectParameterivARB(fragment_shader, GL_OBJECT_COMPILE_STATUS_ARB, &fragment_shader_compiled);

        if (!fragment_shader_compiled) {
            boost::scoped_array<char> fragment_compile_output(new char[512]);
            glGetInfoLogARB(fragment_shader, 512., NULL, fragment_compile_output.get());
            std::cerr << fragment_compile_output.get() << std::endl;
        }

        glAttachObjectARB(blur_program, fragment_shader);
        glLinkProgramARB(blur_program);

        GLint fragment_shader_linked = 0;
        glGetObjectParameterivARB(blur_program, GL_OBJECT_LINK_STATUS_ARB, &fragment_shader_linked);

        if (!fragment_shader_linked) {
            boost::scoped_array<char> fragment_link_output(new char[512]);
            glGetInfoLogARB(blur_program, 512, NULL, fragment_link_output.get());
            std::cerr << fragment_link_output.get() << std::endl;
        }
When I run my program, I get this output on the console:
Ç─▼X¨ì☻
This seems to be coming from the linking step, as slightly modifying the shader code gets me this:
ERROR: 0:1: 'q' : syntax error parse error


Ç─6X¨ø☻:1: 'q' : syntax error parse error
Any ideas what I'm doing wrong? I'm not sure what to search for, since I'm not getting a usable error message. Searching for the various gl commands just gives me examples on how to use them, which I'm attempting to follow.

This topic is closed to new replies.

Advertisement