Type 'EGL_DEFAULT_DISPLAY' could not be resolved error while constant is clearly defined

I'm working on a native activity app for Android 2.3.3. I've copied the code from the code samples, I have include paths set, but Eclipse (Indigo) still can't find this constant.

EGLDisplay display = eglGetDisplay(EGL_DEFAULT_DISPLAY);//Type 'EGL_DEFAULT_DISPLAY' could not be resolved

However the compiler shows no error:

Compile++ thumb  :NativeTest<=NativeTest.cpp

This error has to do with Eclipse not having __ ANDROID__ defined which makes it not define EGLNativeDisplayType in EGL/eglplatform.h which causes EGL_DEFAULT_DISPLAY to also not be defined.

To fix this go to your projects properties and go to the "C/C++ General->Paths and Symbols" page, under the "Symbols" tab click on GNU C and then the "Add" button and put

__ANDROID__

in the name feild and click OK. You can do the same for GNU C++.

发布者

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注