jeudi 31 mars 2016

undefined reference to static const member

I'm stumbling across an unexpeceted behavior and can't get my head around it. Let's take this snippet

/********** Object.h *************/
#define GL_GLEXT_PROTOTYPES 1
#include <glm/glm.hpp>
#include <GL/gl.h>

class Object
{
putlic:
    Object();

private:
    static const initVAO
}



/********** Objet.cpp *************/

Object::Object()
{
    glBindVertexArray( initVAO );
}

For some reasons during linking it throws me an error "undefined reference to `Object::initVAO'" . But as soon as I remove "static const" from initVAO declaration it works fine. Why ?

ps : pretty sure it's a stupid mistake, I'm lacking several hours of sleep.

Aucun commentaire:

Enregistrer un commentaire