• 13
• 18
• 19
• 27
• 9

# EGLInterface error C2078: too many initializers

This topic is 4512 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Edit: This is C++ code High everybody. I'm creating an EGLInterface class to encapsulate all of my EGL stuff. But, I'm having a little bit of trouble. Inside my EGLInterface.h header, I create my EGLint configAttribs[] and in my EGLInterface.cpp, I set
const			 EGLint			 configAttribs	= {
EGL_ALPHA_SIZE,	0,
EGL_RED_SIZE,	8,
EGL_GREEN_SIZE,	8,
EGL_BLUE_SIZE,	8,
EGL_DEPTH_SIZE,	24,
EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
EGL_NONE
};


Whenever I compile, I get
errorC2078: too many initializers
Here are the relevant chunks "Cut and Pasted" from my header and source files. Header:

class EGLInterface
{
.
.
.
private:
EGLint             configAttribs[25]; /*I know this is bigger than it needs to be, but it wouldn't let me define it empty, and whenever I set size equal to 13, it still threw the error C2078.  I just set it to this size to ensure that it was large enough
*/

}


Source
#include "EGLInterface.h"

.
.
.
const			 EGLint			 configAttribs	= {
EGL_ALPHA_SIZE,	0,
EGL_RED_SIZE,	8,
EGL_GREEN_SIZE,	8,
EGL_BLUE_SIZE,	8,
EGL_DEPTH_SIZE,	24,
EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
EGL_NONE
};
.
.
.


any help would be greatly appreciated. ...Also, I sporadically get an error
C:\Program Files\Windows CE Tools\wce420\POCKET PC 2003\Include\emulator\GLES\egltypes.h(38): Could not find the file e32def.h.


but, if I compile again (without any changes whatsoever) it magically disappears. Anybody know what causes this?

##### Share on other sites
Thin you need a [] on the end of that configAttribs, but I could be wrong.