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 7 of 7

Thread: Link Error: glew

Threaded View

  1. #1
    Junior Member Newbie
    Join Date
    Apr 2013
    Posts
    4

    Question Link Error: glew

    Hello,

    IDE: code::blocks 10.05
    compiler: gnu gcc

    code:


    #define GLEW_STATIC
    #include <GL/glew.h>
    #include <GL/freeglut.h>
    #include <GL/glext.h>
    #include <stdlib.h>
    #include <iostream>

    using namespace std;

    enum VAO_IDs {Triangles,NumVAOs};
    enum Buffer_IDs {ArrayBuffer, NumBuffers};
    enum Attrib_IDs {vPosition=0};

    GLuint VAOs[NumVAOs];
    GLuint Buffers[NumBuffers];

    const GLuint NumVertices = 6;

    /* GLUT callback Handlers */

    void resize(int width, int height)
    {

    }

    void display(void)
    {

    }

    void key(unsigned char key, int x, int y)
    {

    }

    void mouse()
    {

    }

    void idle(void)
    {

    }

    void init(void)
    {
    glGenVertexArrays(NumVAOs,VAOs);
    glBindVertexArray(VAOs[Triangles]);

    // GLfloat vertices[NumVertices][2]={
    // {-0.9,-0.9},{0.85,-0.9},{-0.9,0.85},{0.9,-0.85},{0.9,0.9},{-0.85,0.9}
    // };
    }
    /* Program entry point */

    int main(int argc, char **argv)
    {
    glutInit(&argc, argv);
    glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
    glutInitWindowSize(640,480);
    glutInitWindowPosition(0,0);
    glutInitContextVersion(4,0);
    glutInitContextProfile(GLUT_CORE_PROFILE);
    glutCreateWindow("scientific");


    GLenum err = glewInit();
    if (GLEW_OK != err)
    {
    /* Problem: glewInit failed, something is seriously wrong. */
    cout << glewGetErrorString(err);

    }

    init();

    glutReshapeFunc(resize);
    glutDisplayFunc(display);
    glutKeyboardFunc(key);

    glutIdleFunc(idle);

    glutMainLoop();

    return EXIT_SUCCESS;
    }

    Error:

    C:...\main.cpp|48|undefined reference to `__glewGenVertexArrays'|
    C:...\main.cpp|49|undefined reference to `__glewBindVertexArray'|



    please help
    Last edited by nice87day; 04-27-2013 at 02:12 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
  •