Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Missing library for glShaderModel in my native C++ Android program

I am not certain what library I need to add for this error:

../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/PhysicsLessons/PhysicsLessons.o: in function 
engine_handle_cmd(android_app*, int):jni/PhysicsLessons.cpp:104: error: undefined reference to 'glShadeModel'

In Android.mk I have this:

LOCAL_LDLIBS    := -lm -lEGL -lGLESv2 -llog -landroid 
LOCAL_STATIC_LIBRARIES := android_native_app_glue

And in Application.mk I am APP_PLATFORM=android-10

I am using ndk8e

like image 593
James Black Avatar asked May 18 '13 19:05

James Black


1 Answers

You are linking against the OpenGL ES2.0 library, which doesn't have the fixed pipeline. glShadeModel is not in there. Check the gl2.h header.

Try linking against libGLESv1_CM

like image 111
Trax Avatar answered Oct 03 '22 09:10

Trax