Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: newbie (stupid) question

  1. #1
    Intern Contributor
    Join Date
    Apr 2003
    Location
    Turin, Italy
    Posts
    94

    newbie (stupid) question

    hi all,
    i have a puzzling problem:
    i am tring to write a small vertex/fragment shader, so i am using the *_PROGRAM_ARB stuff.
    i included the glext.h file (and i downloaded the latest release from the oss site). Still when i tri to compile&link my program it keeps me sayng:

    [enrico@client4 render]$ make
    g++ -g -c eptagon.cpp
    eptagon.cpp: In function `GLuint load_program(char*, unsigned int)':
    eptagon.cpp:94: `GL_FRAGMENT_PROGRAM_ARB' undeclared (first use this function)
    eptagon.cpp:94: (Each undeclared identifier is reported only once for each
    function it appears in.)
    eptagon.cpp:98: `glGenProgramsARB' undeclared (first use this function)
    eptagon.cpp:100: `glBindProgramARB' undeclared (first use this function)
    eptagon.cpp:103: `glProgramStringARB' undeclared (first use this function)
    make: *** [eptagon.o] Error 1

    now where am i wrong? All glSomethingARB functions should be declared/defined in glext.h, right? What else am I missing? I am including glut.h too (and just to be safe gl.h and glu.h).
    If anyone has some hints, lemme know. Thanks for the help, bye

  2. #2
    Member Regular Contributor
    Join Date
    Apr 2002
    Location
    Austria
    Posts
    328

    Re: newbie (stupid) question

    Are you sure that you have the newest glext.h?

    Try download this own, should include ARB_vertex_program and ARB_fragment_program:
    http://oss.sgi.com/projects/ogl-sample/ABI/glext.h
    There is a theory which states that if ever anybody discovers exactly what the Universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarre and inexplicable.

    There is another theory which states that this has already happened...

  3. #3
    Intern Contributor
    Join Date
    Apr 2003
    Location
    Turin, Italy
    Posts
    94

    Re: newbie (stupid) question

    thanks for the advice, corral,
    anyway i already had the latest glext.h

    however i solved the problem adding a

    #define GL_GLEXT_PROTOTYPES

    before any other #include in my program, so now it look like:

    #include <stdio.h>

    #define GL_GLEXT_PROTOTYPES

    #include <GL/glut.h>
    #include <GL/gl.h>
    #include <GL/glu.h>
    #include <stdlib.h>
    #include "glext.h"
    #include <string.h>
    #include "eptagon.h"

    the only thing i can't understand yet is why it won't read the definition of

    GL_FRAGMENT_PROGRAM_ARB from the glext file.
    I have to define it explicity in my code.
    Thanks again and bye!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •