Jump to content
  • Advertisement
Sign in to follow this  
Geoff the Medio

OpenGL GLSL linker info log garbled

This topic is 3612 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!