Undefined symbols during linking

This forum is about all development around libVLC.
npuleio
Blank Cone
Blank Cone
Posts: 17
Joined: 22 Nov 2023 16:48

Undefined symbols during linking

Postby npuleio » 15 Feb 2024 17:47

Hello everyone!

I am trying to compile libvlc from last VLC Android sources, where I prepared manually inside vlc-android directory also libvlcjni sources on Ubuntu 20.04 with Android NDK 25.2.9519653 as asked from compile.sh procedure but, at certain moment during linker it reported this error:

Code: Select all

make[4]: Entering directory '......../projects/vlc-android/libvlcjni/vlc/build-android-x86_64-linux-android/modules' GEN libfreetype_plugin.la CCLD libandroid_display_plugin.la ld: error: undefined symbol: AWindowHandler_canSetVideoLayout >>> referenced by display.c:490 (../../modules/video_output/android/display.c:490) >>> video_output/android/.libs/libandroid_display_plugin_la-display.o:(Open) ld: error: undefined symbol: __cxa_begin_catch >>> referenced by hb-face.cc >>> hb-face.cc.o:(__clang_call_terminate) in archive ....../projects/vlc-android/libvlcjni/vlc/contrib/x86_64-linux-android/lib/libharfbuzz.a ld: error: undefined symbol: std::terminate() >>> referenced by hb-face.cc >>> hb-face.cc.o:(__clang_call_terminate) in archive ....../projects/vlc-android/libvlcjni/vlc/contrib/x86_64-linux-android/lib/libharfbuzz.a ld: error: undefined symbol: __gxx_personality_v0 >>> referenced by hb-face.cc >>> hb-face.cc.o:(DW.ref.__gxx_personality_v0) in archive ...../projects/vlc-android/libvlcjni/vlc/contrib/x86_64-linux-android/lib/libharfbuzz.a ld: error: undefined symbol: AWindowHandler_getANativeWindow >>> referenced by display.c:517 (../../modules/video_output/android/display.c:517) >>> video_output/android/.libs/libandroid_display_plugin_la-display.o:(Open) ld: error: undefined symbol: AWindowHandler_setVideoLayout >>> referenced by display.c:538 (../../modules/video_output/android/display.c:538) >>> video_output/android/.libs/libandroid_display_plugin_la-display.o:(Open) >>> referenced by display.c:473 (../../modules/video_output/android/display.c:473) >>> video_output/android/.libs/libandroid_display_plugin_la-display.o:(Close) >>> referenced by display.c:0 (../../modules/video_output/android/display.c:0) >>> video_output/android/.libs/libandroid_display_plugin_la-display.o:(Control) ld: error: undefined symbol: vlc_gl_sub_renderer_New >>> referenced by display.c:363 (../../modules/video_output/android/display.c:363) >>> video_output/android/.libs/libandroid_display_plugin_la-display.o:(subpicture_OpenDisplay) ld: error: undefined symbol: vlc_gl_sub_renderer_Delete >>> referenced by display.c:261 (../../modules/video_output/android/display.c:261) >>> video_output/android/.libs/libandroid_display_plugin_la-display.o:(Close) ld: error: undefined symbol: vlc_gl_sub_renderer_Prepare >>> referenced by display.c:215 (../../modules/video_output/android/display.c:215) >>> video_output/android/.libs/libandroid_display_plugin_la-display.o:(Prepare) ld: error: undefined symbol: vlc_gl_sub_renderer_Draw >>> referenced by display.c:227 (../../modules/video_output/android/display.c:227) >>> video_output/android/.libs/libandroid_display_plugin_la-display.o:(Prepare) clang-14: error: linker command failed with exit code 1 (use -v to see invocation) clang-14: error: linker command failed with exit code 1 (use -v to see invocation) make[4]: *** [Makefile:19918: libfreetype_plugin.la] Error 1

and googling around I figured it's something about -fexceptions flag which should be removed to make it working but I haven't found where would this -fexceptions flag affect to this harfbuzz to make this error.... I tried also to put a -fno_exceptions flag in a Makefile where it calls for $(CXXFLAGS) but it didn't worked... do you have any suggest about it?

Thanks in advance!
Cheers!

npuleio
Blank Cone
Blank Cone
Posts: 17
Joined: 22 Nov 2023 16:48

Re: Undefined symbols during linking

Postby npuleio » 16 Feb 2024 11:43

Hello! I figured out about that linker error about libharfbuzz: I just removed from compile-libvlc.sh that -fexceptions flag and with new clean sources I start rebuild again running compile.sh and that error disappeared as well.
But now since I am compiling under Ubuntu 20.04 I get this error, even if I have completed removed -fexceptions flag :

Code: Select all

ld: error: undefined symbol: AWindowHandler_canSetVideoLayout >>> referenced by display.c:490 (../../modules/video_output/android/display.c:490) >>> video_output/android/.libs/libandroid_display_plugin_la-display.o:(Open) ld: error: undefined symbol: AWindowHandler_getANativeWindow >>> referenced by display.c:517 (../../modules/video_output/android/display.c:517) >>> video_output/android/.libs/libandroid_display_plugin_la-display.o:(Open) ld: error: undefined symbol: AWindowHandler_setVideoLayout >>> referenced by display.c:538 (../../modules/video_output/android/display.c:538) >>> video_output/android/.libs/libandroid_display_plugin_la-display.o:(Open) >>> referenced by display.c:473 (../../modules/video_output/android/display.c:473) >>> video_output/android/.libs/libandroid_display_plugin_la-display.o:(Close) >>> referenced by display.c:0 (../../modules/video_output/android/display.c:0) >>> video_output/android/.libs/libandroid_display_plugin_la-display.o:(Control) ld: error: undefined symbol: vlc_gl_sub_renderer_New >>> referenced by display.c:363 (../../modules/video_output/android/display.c:363) >>> video_output/android/.libs/libandroid_display_plugin_la-display.o:(subpicture_OpenDisplay) ld: error: undefined symbol: vlc_gl_sub_renderer_Delete >>> referenced by display.c:261 (../../modules/video_output/android/display.c:261) >>> video_output/android/.libs/libandroid_display_plugin_la-display.o:(Close) ld: error: undefined symbol: vlc_gl_sub_renderer_Prepare >>> referenced by display.c:215 (../../modules/video_output/android/display.c:215) >>> video_output/android/.libs/libandroid_display_plugin_la-display.o:(Prepare) ld: error: undefined symbol: vlc_gl_sub_renderer_Draw >>> referenced by display.c:227 (../../modules/video_output/android/display.c:227) >>> video_output/android/.libs/libandroid_display_plugin_la-display.o:(Prepare) clang-14: error: linker command failed with exit code 1 (use -v to see invocation)
What's that AWindowHandler related under Ubuntu compilation? Is there a way to avoid that one , maybe like adding or removing any flags, since I am compiling for x86_64 and arm64 platforms call? Or maybe there should be any system libraries needed to compile AWindowHandler class? If yes, do you know which library should be so I could install it and then compile with success?...
Thanks in advance all!
Cheers

npuleio
Blank Cone
Blank Cone
Posts: 17
Joined: 22 Nov 2023 16:48

Re: Undefined symbols during linking

Postby npuleio » 19 Feb 2024 09:46

Hello everyone!
I searched around ubuntu and google but I haven't found any reference to AWindowHandler class as in the error reported in previous post.... Shall I have maybe to get from VideoLan github any libraries that contains that AWindowHandler and compile it before to run LibVLC's compile.sh and if yes, which sources shall I have to download and compile first? ...
Thanks to all in advance!
Cheers! :-)

npuleio
Blank Cone
Blank Cone
Posts: 17
Joined: 22 Nov 2023 16:48

Re: Undefined symbols during linking

Postby npuleio » 23 Feb 2024 08:41

Any directions about that AWindowHandler class? Is that from some other VideoLAN's github libraries or should it be a core linux library? Thanks to everyone!!

npuleio
Blank Cone
Blank Cone
Posts: 17
Joined: 22 Nov 2023 16:48

Re: Undefined symbols during linking

Postby npuleio » 02 Mar 2024 14:51

UPDATE: it looks I figured it to make compiling with success.
Practically, I tried like 3-4 times to re-try to compile, after doing some sudo apt update/upgrade, and trying to read better that compile.sh and compile-libvlc.sh as release and then it worked obtaining libvlc-release.aar and libc++_shared.so and libvlc.so and libvlcjni.so. 8)


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 13 guests