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: OpenGL 3.x/4.x headers on linux mint?

  1. #1
    Newbie Newbie
    Join Date
    Jul 2013
    Posts
    2

    OpenGL 3.x/4.x headers on linux mint?

    Hello, when I am trying to create a program using GLFW 3.x (it was A PAIN to compile and work) on linux and syntax such as glGenVertexArrays(); they aren't being found. I have installed (barely managed) nvidia's 319 proprietary drivers for my GTX 760 graphics card with the --opengl-headers flag which installs the included gl.h. I also have ALL the dev files for OpenGL/mesa

    Despite this, this is what I get:

    main.cpp: In function ‘int main()’:
    main.cpp:18:27: error: ‘glGenVertexArrays’ was not declared in this scope
    main.cpp:19:35: error: ‘glBindBuffer’ was not declared in this scope


    NOTE: GLFW 3.0 automatically loads GL/gl.h. I know it works since something like glClear(); is recognized. I can provide my code if needed.

    If I include GL/glew.h before GLFW/glfw3.h (since glfw3 detects header includes put before it, and gives me a slew of additional errors if its put after glfw3) I will get this:

    /tmp/ccUn7ZJ0.o: In function `main':
    main.cpp: (.text+0x4b): undefined reference to `__glewGenVertexArrays'
    main.cpp: (.text+0x5e): undefined reference to `__glewBindBuffer'

    Running Linux Mint 15 olivia + GTX 760 (319 latest drivers from official site).

    Thanks.
    Last edited by cellsheet; 07-16-2013 at 05:57 PM. Reason: including glew error's

  2. #2
    Member Regular Contributor
    Join Date
    Jun 2013
    Posts
    474
    Quote Originally Posted by cellsheet View Post
    main.cpp: In function ‘int main()’:
    main.cpp:18:27: error: ‘glGenVertexArrays’ was not declared in this scope
    main.cpp:19:35: error: ‘glBindBuffer’ was not declared in this scope
    You need to define GL_GLEXT_PROTOTYPES before including <GL/gl.h> if you want prototypes for functions not in OpenGL 1.3. Otherwise, you just get typedefs for function pointers (for use with glXGetProcAddress).

    Quote Originally Posted by cellsheet View Post
    If I include GL/glew.h before GLFW/glfw3.h (since glfw3 detects header includes put before it, and gives me a slew of additional errors if its put after glfw3) I will get this:

    /tmp/ccUn7ZJ0.o: In function `main':
    main.cpp: (.text+0x4b): undefined reference to `__glewGenVertexArrays'
    main.cpp: (.text+0x5e): undefined reference to `__glewBindBuffer'
    Are you linking with "-lGLEW"?

  3. #3
    Newbie Newbie
    Join Date
    Jul 2013
    Posts
    2
    I was not, thanks.
    Last edited by cellsheet; 07-17-2013 at 08:26 AM.

Posting Permissions

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