Android NDK: Linking "error: undefined reference to" GLES functions -
so have following on android.mk....
... local_c_includes := $(local_path)/include /users/myname/development/android/android-ndk-r8c/platforms/android-14/arch-arm/usr/include ... local_ldlibs := -ldl -lglesv1_cm -llog
however, when try running ndk-build following....
/users/myname/development/android/android-ndk-r8c/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/libsdl.a(sdl_render_gles.o): in function gles_createrenderer:jni/sdl/src/render/opengles/sdl_render_gles.c:189: error: undefined reference 'gldisableclientstate' collect2: ld returned 1 exit status
this of course appears issue linking, however, compiler worked fine. confused why linking wouldn't work compilation would. anyonw know how fix it?
from ndk-build v=1 >build.log output
update:
ok taking code found here compiles fine, however, trying upgrade prboom+ dl code here , tweak android.mk include new classes. once done seems compile fine, however, fails link. there 2 main errors see...
first involving multiple definitions, however, original (compiled linked fine) code had same multiple definitions....
/users/me/development/android/android-ndk-r8c/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: error: ./obj/local/armeabi/objs-debug/prboom_jni/w_mmap.o: multiple definition of 'w_initcache'
the other type opengl issues...
/users/me/development/android/android-ndk-r8c/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/libsdl.a(sdl_render_gles.o): in function gles_resetstate:/users/jackiegleason/development/code/prboom4android-base/jni/sdl/src/render/opengles/sdl_render_gles.c:181: error: undefined reference 'gldisable'
if copy (using prboom4android code) compiles , links fine.
here diff of 2 android.mk files...
< local_c_includes:= $(local_path) $(local_path)/include $(local_path)/../sdl_net/include $(local_path)/../sdl/include $(local_path)/music $(local_path)/music/include $(local_path)/textscreen $(local_path)/textscreen/include --- > local_c_includes:= $(local_path) $(local_path)/include $(local_path)/../sdl_net/include $(local_path)/../sdl/include 28c28 < f_finale.c p_enemy.c p_spec.c r_plane.c w_mmap.c i_capture.c \ --- > f_finale.c p_enemy.c p_spec.c r_plane.c w_mmap.c \ 31,36c31,33 < m_bbox.c p_inter.c p_tick.c r_things.c z_zone.c s_advsound.c memio.c \ < d_client.c i_video.c i_network.c i_system.c pcsound/pcsound.c pcsound/pcsound_sdl.c sdl/i_sshot.c \ < i_main.c sc_man.c sdl/i_sound.c jni_doom.c mus2mid.c pcm2wav.c e6y.c sdl/i_joy.c \ < r_screenmultiply.c hu_tracers.c i_smp.c g_overflow.c i_pcsound.c \ < music/dbopl.c music/flplayer.c music/portmidiplayer.c music/midifile.c music/opl_queue.c music/vorbisplayer.c music/dumbplayer.c music/oplplayer.c music/madplayer.c music/opl.c \ < textscreen/txt_button.c textscreen/txt_separator.c textscreen/txt_gui.c textscreen/txt_widget.c textscreen/txt_checkbox.c textscreen/txt_radiobutton.c textscreen/txt_inputbox.c textscreen/txt_spinctrl.c textscreen/txt_window.c textscreen/txt_desktop.c textscreen/txt_scrollpane.c textscreen/txt_io.c textscreen/txt_strut.c textscreen/txt_window_action.c textscreen/txt_dropdown.c textscreen/txt_sdl.c textscreen/txt_label.c textscreen/txt_table.c --- > m_bbox.c p_inter.c p_tick.c r_things.c z_zone.c \ > d_client.c i_video.c i_network.c i_system.c \ > i_main.c i_sound.c jni_doom.c mmus2mid.c pcm2wav.c
yes, download build.log.
your build uses app_platform = android-3
, not have necessary gl libraries. can set app_platform = android-14
in application.mk, or set target platform android project (eclipse update project.properties file).
you should not add android-14 includes manually in android.mk. when have correct app_platform, include path adjusted accordingly.
Comments
Post a Comment