1

I tried to create a simple game project using andEngine and Android studio

I have downloaded the andEngine source, android NDK and configured the project. However, while compiling I'm getting following error

E:\Android\GameTest\andEngine\src\main\jni\src\GLES20Fix.c
Error:(9) undefined reference to `glVertexAttribPointer'
Error:(13) undefined reference to `glDrawElements'
collect2.exe: error: ld returned 1 exit status
make.exe: *** [E:\Android\GameTest\andEngine\build\intermediates\ndk\debug\obj/local/arm64-v8a/libandengine_shared.so] Error 1

It seems like I'm missing something.

I have changed the default location of NDK to D:\AndroidNDK\android-ndk-r10d

I need guidance on how to what exactly this means and what steps should I follow to successfully compile a project which reference andEngine.

yole
  • 92,896
  • 20
  • 260
  • 197
Murtuza Kabul
  • 6,438
  • 6
  • 27
  • 34

2 Answers2

1

I solved this issue by adding ldLibs "GLESv2" to the defaultConfig block of the andEngine build.gradle.

defaultConfig {
    minSdkVersion 8
    targetSdkVersion 8

    ndk {
        moduleName "andengine_shared"
        ldLibs "GLESv2"
    }
}

See this post

Community
  • 1
  • 1
ya man
  • 443
  • 1
  • 10
  • 15
0

You don't need to compile the NDK source, you can use the built-in compiled jniLibs.

See my answer here:

ExceptionInInitializerError Physics World

Community
  • 1
  • 1
Szörényi Ádám
  • 1,223
  • 13
  • 17