Cannot find function in <GLES2/gl2.h> by Android Native Activity

  android, android-ndk, c++, native-activity

I was thinking of studying OpenGL ES with Android Native Activity, but when I use the API of OpenGL ES 2.0 even though I can use OpenGL ES 1.0, I get a message saying "Undefined symbo l !!"

OpenGL ES 2.0 png

1>ANDROID_HOME=D:aruzeMicrosoftAndroidSDK
1>ANT_HOME=C:Program Files (x86)Microsoft Visual Studio19CommunityAppsapache-ant-1.9.3
1>JAVA_HOME=C:Program FilesAndroidjdkmicrosoft_dist_openjdk_1.8.0.25
1>NDK_ROOT=D:aruzeMicrosoftAndroidNDK64android-ndk-r16b
1>pch.h
1>android_native_app_glue.c
1>startup.cpp
1>System.cpp
1>main.cpp
1>ld: error: undefined symbol: glCreateShader
1>>>> referenced by startup.cpp:47
1>>>>               ARMReleasestartup.o:(loadShader(unsigned int, char const*))
1>>>> referenced by startup.cpp:47
1>>>>               ARMReleasestartup.o:(createProgram(char const*, char const*))
1>>>> referenced by startup.cpp:47
1>>>>               ARMReleasestartup.o:(createProgram(char const*, char const*))
・
・
・
・
1>>>> referenced by startup.cpp:137
1>>>>               ARMReleasestartup.o:(engine_init_display(Engine&))
1>clang: error: linker command failed with exit code 1 (use -v to see invocation)

I tried repairing Visual Studio and Android SDK manager

Is it because I’m debugging on my old smartphone?

Source: Windows Questions C++

LEAVE A COMMENT