Error: Type 'EGL_DEFAULT_DISPLAY' could not be resolved when tried to use Open GL purely in C++ NativeActivity in NDK

StackOverflow https://stackoverflow.com/questions/22143794

  •  19-10-2022
  •  | 
  •  

문제

Can anyone suggest how start learning Open GL implementation in pure C++ in a NativeActivity in Android NDK without using jni.

I have tried running the sample NativeActivity that comes with the NDK setup, but I am not able to run it. Giving error

Type 'EGL_DEFAULT_DISPLAY' could not be resolved

Can anyone suggest how to resolve this error.

도움이 되었습니까?

해결책

Resolved the error

just add the statement typedef void* EGLNativeDisplayType; before the statement #include <EGL/egl.h> in main.c in the NativeActivity

다른 팁

Can be handled by including source SUB directories as well as their parents in project > properties >C/C++ General > Paths and Symbols > Includes(tab).

e.g. add

${env_var:ANDROID_NDK}/platforms/android-19/arch-arm/usr/include/EGL

as well as

${env_var:ANDROID_NDK}/platforms/android-19/arch-arm/usr/include

Maybe the syntax parser (if there is such a thing) misses the sub-folders?

include the ${env_var:ANDROID_NDK}/platforms/android-19/arch-arm/usr/include/EGL is a partial correct, after this, comment out all content in Application.mk, then close main.c, clean the project, open main.c again, see the error is disappear, then recovery the Application.mk.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top