Pangolin Tools Building Error - undefined reference - Linux 4.9.241 aarch64 Ubuntu 20.04 Khadas Vim3

Hello,
Here are some errors showing below when I build the repo Pangolin-v0.6. Those same errors will occur 5 times for each of these 5 tools. Does anyone know what is the reason? It looks like a GNU dependency problem, but I don’t know how to fix it. Thanks in advance.

Others infromations:
Kernel: Linux 4.9.241 aarch64 (the official latest)
OS: Ubuntu 20.04
Machine: Khadas Vim3
GNU: gcc-7 gcc-8 gcc-9

[ 94%] Linking CXX executable VideoJsonPrint
[ 95%] Linking CXX executable VideoConvert
[ 96%] Linking CXX executable VideoViewer
[ 97%] Linking CXX executable VideoJsonTransform
[ 98%] Linking CXX executable Plotter
[100%] Linking CXX executable ModelViewer
/usr/bin/ld: /lib/aarch64-linux-gnu/libsndio.so.7.0: undefined reference to `snd_pcm_sw_params_set_period_event@ALSA_0.9'
/usr/bin/ld: /usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu/libavdevice.so: undefined reference to `snd_pcm_readi@ALSA_0.9'
/usr/bin/ld: /usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu/libavdevice.so: undefined reference to `snd_pcm_nonblock@ALSA_0.9'
/usr/bin/ld: /lib/aarch64-linux-gnu/libsndio.so.7.0: undefined reference to `snd_rawmidi_poll_descriptors_count@ALSA_0.9'
/usr/bin/ld: /usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu/libavdevice.so: undefined reference to `snd_pcm_hw_params_set_rate_near@ALSA_0.9.0rc4'
/usr/bin/ld: /lib/aarch64-linux-gnu/libsndio.so.7.0: undefined reference to `snd_pcm_hw_params_test_channels@ALSA_0.9'
/usr/bin/ld: /lib/aarch64-linux-gnu/libSDL2-2.0.so.0: undefined reference to `snd_pcm_hw_params_copy@ALSA_0.9'
/usr/bin/ld: /usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu/libavdevice.so: undefined reference to `snd_pcm_hw_params_get_period_size_min@ALSA_0.9.0rc4'
/usr/bin/ld: /lib/aarch64-linux-gnu/libSDL2-2.0.so.0: undefined reference to `snd_pcm_sw_params_sizeof@ALSA_0.9'
/usr/bin/ld: /usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu/libavdevice.so: undefined reference to `snd_pcm_hw_params_get_buffer_size_max@ALSA_0.9.0rc4'
/usr/bin/ld: /lib/aarch64-linux-gnu/libSDL2-2.0.so.0: undefined reference to `snd_pcm_hw_params_get_buffer_size@ALSA_0.9.0rc4'
/usr/bin/ld: /lib/aarch64-linux-gnu/libsndio.so.7.0: undefined reference to `snd_rawmidi_open@ALSA_0.9'
/usr/bin/ld: /lib/aarch64-linux-gnu/libsndio.so.7.0: undefined reference to `snd_rawmidi_close@ALSA_0.9'
/usr/bin/ld: /lib/aarch64-linux-gnu/libSDL2-2.0.so.0: undefined reference to `snd_pcm_hw_params_get_channels@ALSA_0.9.0rc4'
/usr/bin/ld: /usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu/libavdevice.so: undefined reference to `snd_device_name_get_hint@ALSA_0.9'
/usr/bin/ld: /lib/aarch64-linux-gnu/libsndio.so.7.0: undefined reference to `snd_pcm_hw_params_set_periods_near@ALSA_0.9.0rc4'
/usr/bin/ld: /lib/aarch64-linux-gnu/libsndio.so.7.0: undefined reference to `snd_pcm_hw_params_set_period_size_integer@ALSA_0.9'
/usr/bin/ld: /usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu/libavdevice.so: undefined reference to `snd_pcm_hw_params@ALSA_0.9'
/usr/bin/ld: /lib/aarch64-linux-gnu/libsndio.so.7.0: undefined reference to `snd_rawmidi_write@ALSA_0.9'
/usr/bin/ld: /usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu/libavdevice.so: undefined reference to `snd_pcm_writei@ALSA_0.9'
/usr/bin/ld: /lib/aarch64-linux-gnu/libsndio.so.7.0: undefined reference to `snd_rawmidi_read@ALSA_0.9'
/usr/bin/ld: /lib/aarch64-linux-gnu/libsndio.so.7.0: undefined reference to `snd_pcm_hw_params_test_format@ALSA_0.9'
/usr/bin/ld: /usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu/libavdevice.so: undefined reference to `snd_pcm_hw_params_set_format@ALSA_0.9'
/usr/bin/ld: /lib/aarch64-linux-gnu/libsndio.so.7.0: undefined reference to `snd_rawmidi_poll_descriptors_revents@ALSA_0.9'
/usr/bin/ld: /usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu/libavdevice.so: undefined reference to `snd_pcm_hw_params_set_channels@ALSA_0.9'
/usr/bin/ld: /lib/aarch64-linux-gnu/libSDL2-2.0.so.0: undefined reference to `snd_pcm_hw_params_sizeof@ALSA_0.9'
/usr/bin/ld: /lib/aarch64-linux-gnu/libSDL2-2.0.so.0: undefined reference to `snd_pcm_sw_params@ALSA_0.9'
/usr/bin/ld: /usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu/libavdevice.so: undefined reference to `snd_pcm_delay@ALSA_0.9'
/usr/bin/ld: /lib/aarch64-linux-gnu/libSDL2-2.0.so.0: undefined reference to `snd_pcm_hw_params_set_periods_first@ALSA_0.9.0rc4'
/usr/bin/ld: /usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu/libavdevice.so: undefined reference to `snd_pcm_close@ALSA_0.9'
/usr/bin/ld: /lib/aarch64-linux-gnu/libsndio.so.7.0: undefined reference to `snd_pcm_hw_params_set_channels_near@ALSA_0.9.0rc4'
/usr/bin/ld: /lib/aarch64-linux-gnu/libsndio.so.7.0: undefined reference to `snd_pcm_link@ALSA_0.9'
/usr/bin/ld: /usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu/libavdevice.so: undefined reference to `snd_pcm_drain@ALSA_0.9'
/usr/bin/ld: /lib/aarch64-linux-gnu/libsndio.so.7.0: undefined reference to `snd_rawmidi_poll_descriptors@ALSA_0.9'
/usr/bin/ld: /lib/aarch64-linux-gnu/libsndio.so.7.0: undefined reference to `snd_pcm_hw_params_test_rate@ALSA_0.9'
/usr/bin/ld: /usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu/libavdevice.so: undefined reference to `snd_pcm_hw_params_set_access@ALSA_0.9'
/usr/bin/ld: /lib/aarch64-linux-gnu/libsndio.so.7.0: undefined reference to `snd_pcm_drop@ALSA_0.9'
/usr/bin/ld: /lib/aarch64-linux-gnu/libSDL2-2.0.so.0: undefined reference to `snd_pcm_recover@ALSA_0.9'
/usr/bin/ld: /lib/aarch64-linux-gnu/libSDL2-2.0.so.0: undefined reference to `snd_pcm_wait@ALSA_0.9'
/usr/bin/ld: /lib/aarch64-linux-gnu/libsndio.so.7.0: undefined reference to `snd_pcm_dump@ALSA_0.9'
/usr/bin/ld: /usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu/libavdevice.so: undefined reference to `snd_device_name_hint@ALSA_0.9'
/usr/bin/ld: /usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu/libavdevice.so: undefined reference to `snd_pcm_stream@ALSA_0.9'
/usr/bin/ld: /lib/aarch64-linux-gnu/libsndio.so.7.0: undefined reference to `snd_output_stdio_attach@ALSA_0.9'
/usr/bin/ld: /usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu/libavdevice.so: undefined reference to `snd_pcm_prepare@ALSA_0.9'
/usr/bin/ld: /lib/aarch64-linux-gnu/libsndio.so.7.0: undefined reference to `snd_pcm_unlink@ALSA_0.9'
/usr/bin/ld: /lib/aarch64-linux-gnu/libsndio.so.7.0: undefined reference to `snd_pcm_start@ALSA_0.9'
/usr/bin/ld: /lib/aarch64-linux-gnu/libsndio.so.7.0: undefined reference to `snd_pcm_sw_params_set_stop_threshold@ALSA_0.9'
/usr/bin/ld: /lib/aarch64-linux-gnu/libflite.so.1: undefined reference to `snd_pcm_hw_params_set_rate@ALSA_0.9'
/usr/bin/ld: /lib/aarch64-linux-gnu/libsndio.so.7.0: undefined reference to `snd_pcm_state@ALSA_0.9'
/usr/bin/ld: /lib/aarch64-linux-gnu/libsndio.so.7.0: undefined reference to `snd_pcm_poll_descriptors@ALSA_0.9'
/usr/bin/ld: /lib/aarch64-linux-gnu/libSDL2-2.0.so.0: undefined reference to `snd_pcm_sw_params_current@ALSA_0.9'
/usr/bin/ld: /lib/aarch64-linux-gnu/libsndio.so.7.0: undefined reference to `snd_pcm_hw_params_set_periods_integer@ALSA_0.9'
/usr/bin/ld: /lib/aarch64-linux-gnu/libSDL2-2.0.so.0: undefined reference to `snd_pcm_get_chmap@ALSA_0.9'
/usr/bin/ld: /lib/aarch64-linux-gnu/libsndio.so.7.0: undefined reference to `snd_rawmidi_drain@ALSA_0.9'
/usr/bin/ld: /usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu/libavdevice.so: undefined reference to `snd_pcm_hw_params_any@ALSA_0.9'
/usr/bin/ld: /lib/aarch64-linux-gnu/libSDL2-2.0.so.0: undefined reference to `snd_pcm_hw_params_set_periods_min@ALSA_0.9'
/usr/bin/ld: /lib/aarch64-linux-gnu/libSDL2-2.0.so.0: undefined reference to `snd_pcm_sw_params_set_start_threshold@ALSA_0.9'
/usr/bin/ld: /usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu/libavdevice.so: undefined reference to `snd_strerror@ALSA_0.9'
/usr/bin/ld: /usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu/libavdevice.so: undefined reference to `snd_pcm_hw_params_free@ALSA_0.9'
/usr/bin/ld: /usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu/libavdevice.so: undefined reference to `snd_pcm_hw_params_set_period_size_near@ALSA_0.9.0rc4'
/usr/bin/ld: /usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu/libavdevice.so: undefined reference to `snd_pcm_hw_params_set_buffer_size_near@ALSA_0.9.0rc4'
/usr/bin/ld: /lib/aarch64-linux-gnu/libSDL2-2.0.so.0: undefined reference to `snd_pcm_reset@ALSA_0.9'
/usr/bin/ld: /lib/aarch64-linux-gnu/libSDL2-2.0.so.0: undefined reference to `snd_pcm_sw_params_set_avail_min@ALSA_0.9'
/usr/bin/ld: /lib/aarch64-linux-gnu/libsndio.so.7.0: undefined reference to `snd_pcm_avail_update@ALSA_0.9'
/usr/bin/ld: /usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu/libavdevice.so: undefined reference to `snd_pcm_open@ALSA_0.9'
/usr/bin/ld: /lib/aarch64-linux-gnu/libflite.so.1: undefined reference to `snd_pcm_resume@ALSA_0.9'
/usr/bin/ld: /lib/aarch64-linux-gnu/libsndio.so.7.0: undefined reference to `snd_pcm_hw_params_set_rate_resample@ALSA_0.9'
/usr/bin/ld: /lib/aarch64-linux-gnu/libsndio.so.7.0: undefined reference to `snd_pcm_poll_descriptors_revents@ALSA_0.9'
/usr/bin/ld: /lib/aarch64-linux-gnu/libflite.so.1: undefined reference to `snd_pcm_set_params@ALSA_0.9'
/usr/bin/ld: /lib/aarch64-linux-gnu/libSDL2-2.0.so.0: undefined reference to `snd_pcm_chmap_print@ALSA_0.9'
/usr/bin/ld: /usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu/libavdevice.so: undefined reference to `snd_device_name_free_hint@ALSA_0.9'
/usr/bin/ld: /usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu/libavdevice.so: undefined reference to `snd_pcm_hw_params_malloc@ALSA_0.9'
/usr/bin/ld: /lib/aarch64-linux-gnu/libflite.so.1: undefined reference to `snd_config_update_free_global@ALSA_0.9'
collect2: error: ld returned 1 exit status
make[2]: *** [tools/VideoViewer/CMakeFiles/VideoViewer.dir/build.make:117:tools/VideoViewer/VideoViewer] Error 1
make[1]: *** [CMakeFiles/Makefile2:352:tools/VideoViewer/CMakeFiles/VideoViewer.dir/all] Error 2

Here is the output of cmake, and i have tried with gcc-7 gcc-8 gcc-9, but there are the same errors.

-- The C compiler identification is GNU 8.4.0
-- The CXX compiler identification is GNU 8.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
Build type not set (defaults to release)
-DCMAKE_BUILD_TYPE=Debug for debug
-- Found OpenGL: /usr/lib/aarch64-linux-gnu/libGL.so   
-- Found GLEW: /usr/lib/aarch64-linux-gnu/libGLEW.so
-- Eigen Found and Enabled
-- libdc1394 Found and Enabled
-- V4L Found and Enabled
-- Performing Test HAVE_FFMPEG_MAX_ANALYZE_DURATION
-- Performing Test HAVE_FFMPEG_MAX_ANALYZE_DURATION - Success
-- Performing Test HAVE_FFMPEG_AVFORMAT_ALLOC_OUTPUT_CONTEXT2
-- Performing Test HAVE_FFMPEG_AVFORMAT_ALLOC_OUTPUT_CONTEXT2 - Success
-- Performing Test HAVE_FFMPEG_AVPIXELFORMAT
-- Performing Test HAVE_FFMPEG_AVPIXELFORMAT - Success
-- ffmpeg Found and Enabled
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1") 
-- LibRealSense2 Found and Enabled
-- OpenNI Found and Enabled
-- OpenNI2 Found and Enabled
-- libpng Found and Enabled
-- libjpeg Found and Enabled
-- libtiff Found and Enabled
-- libopenexr Found and Enabled
-- libzstd Found and Enabled
-- liblz4 Found and Enabled
-- Found Doxygen: /usr/bin/doxygen (found version "1.8.17") found components: doxygen dot 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/khadas/src/Pangolin-0.6/build

Hello @w407022008

Can you try this ?

$ sudo apt install --reinstall libasound2

And then try to build again.

Hello @numbqq ,
Thank you very much. It is fixed.