Results 1 to 7 of 7

Thread: What do I link with to get glslang?

  1. #1
    Senior Member Regular Contributor
    Join Date
    Aug 2003
    Posts
    369

    What do I link with to get glslang?

    Hi people. I've finally gotten around to start writing some glslang code. I think my code compiles correctly but I get linker errors. My makefile looks like this:
    Code :
    glslang: main.cpp
        g++ -o glslang main.cpp -lglut
    I get errors like:
    Code :
    g++ -o glslang main.cpp -lglut
    /tmp/ccXPf0aL.o(.text+0x19b): In function `InitGL()':
    main.cpp: undefined reference to `glCreateProgramObjectARB'
    /tmp/ccXPf0aL.o(.text+0x1c3):main.cpp: undefined reference to `glCreateShaderObjectARB'
    /tmp/ccXPf0aL.o(.text+0x1e1):main.cpp: undefined reference to `glShaderSourceARB'
    /tmp/ccXPf0aL.o(.text+0x1f2):main.cpp: undefined reference to `glCompileShaderARB'
    /tmp/ccXPf0aL.o(.text+0x20f):main.cpp: undefined reference to `glGetObjectParameterivARB'
    /tmp/ccXPf0aL.o(.text+0x258):main.cpp: undefined reference to `glGetInfoLogARB'
    /tmp/ccXPf0aL.o(.text+0x2b2):main.cpp: undefined reference to `glAttachObjectARB'
    What library do I need to add to gcc to link proper? Thanks for your time.

  2. #2
    Senior Member Regular Contributor
    Join Date
    Jan 2004
    Posts
    314

    Re: What do I link with to get glslang?

    Try adding -lGL

    That should be enough - since glsl is part of GL2.0 core, and implemented in the driver.
    But it has to be a 2.0 lib. Be sure you also have the 2.0 libs in your library link path.

  3. #3
    Senior Member Regular Contributor
    Join Date
    Sep 2002
    Location
    Dresden, Sachsen, Germany
    Posts
    203

    Re: What do I link with to get glslang?

    make sure that the necessary extensions are defined

  4. #4
    Senior Member Regular Contributor
    Join Date
    Aug 2003
    Posts
    369

    Re: What do I link with to get glslang?

    Found it! I had to use the glXGetProcAddress. Then I came to some other problems but finally I've been able to resolve the situation and start writing some of the shaders that are in the OpenGL Shading Language book.
    But I'd like to take this opportunity and point out that the aforementioned book should provide a basic example of how one sets up a program to use shaders. It does provide snippets of settinp things up, but I couldn't find a complete example, thus had to resort to an example from the internet.
    Anyway, I've much to learn now that I know how to write shaders.

    PS It's a shame that ATI still don't provide OpenGL 2.0 functionality in their driver yet. The version supported in the latest release is 1.3 in Linux.

  5. #5
    Senior Member Regular Contributor
    Join Date
    Sep 2002
    Location
    Dresden, Sachsen, Germany
    Posts
    203

    Re: What do I link with to get glslang?

    there is the example with the basic pair of shaders and it is exactly this path you have to follow in order to set up your app for shaders ...

    like loading the source for a shader, compile it, provide it to the shader, attach it, create a program object, link the source and use the program object

  6. #6
    Senior Member Regular Contributor
    Join Date
    Aug 2003
    Posts
    369

    Re: What do I link with to get glslang?

    Yes, I hadn't read chapter 7 at the time I last posted. I just started reading it and things are becoming a lot clearer. My bad. I just expected to see an example including some glut initialization code. This is why I got lost.

  7. #7
    Senior Member Regular Contributor
    Join Date
    Jan 2004
    Posts
    314

    Re: What do I link with to get glslang?

    dvm - sorry for going a bit off-topic here, but you mention ATi on Linux. I take it it's working fine for you (other than GL version)?

    There's a very frustrated "ZigZag" lurking on the Linux forum. Maybe you can help him out?

Similar Threads

  1. GLSlang not catching compile errors, always failing to link
    By imported_JoshKlint in forum OpenGL: GLSL
    Replies: 0
    Last Post: 06-04-2016, 02:08 PM
  2. GLSlang
    By amendola in forum OpenGL: Linux
    Replies: 7
    Last Post: 06-30-2004, 12:39 PM
  3. GLslang
    By enmaniac in forum OpenGL: GLSL
    Replies: 1
    Last Post: 12-24-2003, 05:42 AM
  4. glslang... when?
    By pedrosl in forum OpenGL: Advanced Coding
    Replies: 24
    Last Post: 07-11-2003, 12:03 AM
  5. Is glslang on its way?
    By Lurking in forum OpenGL: Advanced Coding
    Replies: 3
    Last Post: 03-25-2003, 06:31 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean