joncampbell123 / permanentrecord

3 stars 0 forks source link

Ubuntu MATE makes if difficult to link to PulseAudio and ALSA and refuses to link the symbols that are clearly already there. #1

Open KGOrphanides opened 5 years ago

KGOrphanides commented 5 years ago

after autoconf and ./configure, make fails with:

CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/bash /home/kg/Software/permanentrecord/missing aclocal-1.14 
/home/kg/Software/permanentrecord/missing: line 81: aclocal-1.14: command not found
WARNING: 'aclocal-1.14' is missing on your system.

I have 1.5:

$ aclocal --version
aclocal (GNU automake) 1.15.1

autoreconf got it to the point of being able to compile and make, but resulted in the following error:

collect2: error: ld returned 1 exit status
Makefile:417: recipe for target 'permrec_audio' failed
make[1]: *** [permrec_audio] Error 1
make[1]: Leaving directory '/home/kg/Software/permanentrecord'
Makefile:321: recipe for target 'all' failed
make: *** [all] Error 2
joncampbell123 commented 5 years ago

Does ./autogen.sh help?

KGOrphanides commented 5 years ago

Sadly not. It compiles, starts making and errors out.

Here's the output:

make all-am make[1]: Entering directory '/home/kg/Software/permanentrecord' g++ -I/usr/include/alsa -D_REENTRANT -g -std=gnu++11 -O2 -Wall -Wextra -pedantic -Wconversion -Wsign-conversion -Wconversion-null -Wno-implicit-fallthrough -Wno-strict-aliasing -Wno-missing-field-initializers -Wno-format-zero-length -Wno-address-of-packed-member -Wno-int-to-void-pointer-cast -Wno-extended-offsetof -pthread -lasound -lpulse -lrt -lm -o permrec_audio permrec_audio-permrec_audio.o permrec_audio-common.o permrec_audio-monclock.o permrec_audio-aufmt.o permrec_audio-ausrc.o permrec_audio-ausrcls.o permrec_audio-aufmtui.o permrec_audio-dbfs.o permrec_audio-autocut.o permrec_audio-as_alsa.o permrec_audio-as_pulse.o permrec_audio-wavwrite.o permrec_audio-recpath.o Makefile:417: recipe for target 'permrec_audio' failed make[1]: Leaving directory '/home/kg/Software/permanentrecord' Makefile:321: recipe for target 'all' failed

And the errors:

permrec_audio-as_alsa.o: In functionalsa_atexit()': /home/kg/Software/permanentrecord/as_alsa.cpp:33: undefined reference to snd_config_update_free_global' permrec_audio-as_alsa.o: In functionAudioSourceALSA::GetAvailable()': /home/kg/Software/permanentrecord/as_alsa.cpp:212: undefined reference to snd_pcm_avail_delay' permrec_audio-as_alsa.o: In functionAudioSourceALSA::Read(void, unsigned int)': /home/kg/Software/permanentrecord/as_alsa.cpp:226: undefined reference to snd_pcm_readi' /home/kg/Software/permanentrecord/as_alsa.cpp:233: undefined reference tosnd_pcm_prepare' /home/kg/Software/permanentrecord/as_alsa.cpp:234: undefined reference to snd_strerror' permrec_audio-as_alsa.o: In functionAudioSourceALSA::Close()': /home/kg/Software/permanentrecord/as_alsa.cpp:462: undefined reference to snd_pcm_hw_params_free' /home/kg/Software/permanentrecord/as_alsa.cpp:466: undefined reference tosnd_pcm_close' permrec_audio-as_alsa.o: In function AudioSourceALSA::~AudioSourceALSA()': /home/kg/Software/permanentrecord/as_alsa.cpp:462: undefined reference tosnd_pcm_hw_params_free' /home/kg/Software/permanentrecord/as_alsa.cpp:466: undefined reference to snd_pcm_close' /home/kg/Software/permanentrecord/as_alsa.cpp:462: undefined reference tosnd_pcm_hw_params_free' /home/kg/Software/permanentrecord/as_alsa.cpp:466: undefined reference to snd_pcm_close' permrec_audio-as_alsa.o: In functionAudioSourceALSA::~AudioSourceALSA()': /home/kg/Software/permanentrecord/as_alsa.cpp:462: undefined reference to snd_pcm_hw_params_free' /home/kg/Software/permanentrecord/as_alsa.cpp:466: undefined reference tosnd_pcm_close' /home/kg/Software/permanentrecord/as_alsa.cpp:462: undefined reference to snd_pcm_hw_params_free' /home/kg/Software/permanentrecord/as_alsa.cpp:466: undefined reference tosnd_pcm_close' permrec_audio-as_alsa.o: In function `AudioSourceALSA::SelectDevice(char const)': /home/kg/Software/permanentrecord/as_alsa.cpp:462: undefined reference to snd_pcm_hw_params_free' /home/kg/Software/permanentrecord/as_alsa.cpp:466: undefined reference tosnd_pcm_close' permrec_audio-as_alsa.o: In function AudioSourceALSA::Open()': /home/kg/Software/permanentrecord/as_alsa.cpp:308: undefined reference tosnd_pcm_hw_params_test_format' /home/kg/Software/permanentrecord/as_alsa.cpp:359: undefined reference to snd_pcm_hw_params_set_format' /home/kg/Software/permanentrecord/as_alsa.cpp:371: undefined reference tosnd_pcm_hw_params_set_channels' /home/kg/Software/permanentrecord/as_alsa.cpp:374: undefined reference to snd_pcm_hw_params_get_channels' /home/kg/Software/permanentrecord/as_alsa.cpp:375: undefined reference tosnd_pcm_hw_params_get_rate' /home/kg/Software/permanentrecord/as_alsa.cpp:376: undefined reference to snd_pcm_hw_params_get_format' /home/kg/Software/permanentrecord/as_alsa.cpp:134: undefined reference tosnd_pcm_hw_params' /home/kg/Software/permanentrecord/as_alsa.cpp:138: undefined reference to snd_pcm_prepare' /home/kg/Software/permanentrecord/as_alsa.cpp:142: undefined reference tosnd_pcm_start' /home/kg/Software/permanentrecord/as_alsa.cpp:440: undefined reference to snd_pcm_open' /home/kg/Software/permanentrecord/as_alsa.cpp:444: undefined reference tosnd_pcm_hw_params_malloc' /home/kg/Software/permanentrecord/as_alsa.cpp:448: undefined reference to snd_pcm_hw_params_any' /home/kg/Software/permanentrecord/as_alsa.cpp:452: undefined reference tosnd_pcm_hw_params_set_access' /home/kg/Software/permanentrecord/as_alsa.cpp:462: undefined reference to snd_pcm_hw_params_free' /home/kg/Software/permanentrecord/as_alsa.cpp:466: undefined reference tosnd_pcm_close' /home/kg/Software/permanentrecord/as_alsa.cpp:462: undefined reference to snd_pcm_hw_params_free' /home/kg/Software/permanentrecord/as_alsa.cpp:466: undefined reference tosnd_pcm_close' /home/kg/Software/permanentrecord/as_alsa.cpp:462: undefined reference to snd_pcm_hw_params_free' /home/kg/Software/permanentrecord/as_alsa.cpp:326: undefined reference tosnd_pcm_hw_params_test_format' /home/kg/Software/permanentrecord/as_alsa.cpp:364: undefined reference to snd_pcm_hw_params_set_rate_near' permrec_audio-as_alsa.o: In functionAudioSourceALSA::SetFormat(AudioFormat const&)': /home/kg/Software/permanentrecord/as_alsa.cpp:308: undefined reference to snd_pcm_hw_params_test_format' /home/kg/Software/permanentrecord/as_alsa.cpp:359: undefined reference tosnd_pcm_hw_params_set_format' /home/kg/Software/permanentrecord/as_alsa.cpp:371: undefined reference to snd_pcm_hw_params_set_channels' /home/kg/Software/permanentrecord/as_alsa.cpp:374: undefined reference tosnd_pcm_hw_params_get_channels' /home/kg/Software/permanentrecord/as_alsa.cpp:466: undefined reference to snd_pcm_close' /home/kg/Software/permanentrecord/as_alsa.cpp:440: undefined reference tosnd_pcm_open' /home/kg/Software/permanentrecord/as_alsa.cpp:444: undefined reference to snd_pcm_hw_params_malloc' /home/kg/Software/permanentrecord/as_alsa.cpp:448: undefined reference tosnd_pcm_hw_params_any' /home/kg/Software/permanentrecord/as_alsa.cpp:452: undefined reference to snd_pcm_hw_params_set_access' /home/kg/Software/permanentrecord/as_alsa.cpp:462: undefined reference tosnd_pcm_hw_params_free' /home/kg/Software/permanentrecord/as_alsa.cpp:466: undefined reference to snd_pcm_close' /home/kg/Software/permanentrecord/as_alsa.cpp:462: undefined reference tosnd_pcm_hw_params_free' /home/kg/Software/permanentrecord/as_alsa.cpp:375: undefined reference to snd_pcm_hw_params_get_rate' /home/kg/Software/permanentrecord/as_alsa.cpp:376: undefined reference tosnd_pcm_hw_params_get_format' /home/kg/Software/permanentrecord/as_alsa.cpp:326: undefined reference to snd_pcm_hw_params_test_format' /home/kg/Software/permanentrecord/as_alsa.cpp:364: undefined reference tosnd_pcm_hw_params_set_rate_near' /home/kg/Software/permanentrecord/as_alsa.cpp:462: undefined reference to snd_pcm_hw_params_free' /home/kg/Software/permanentrecord/as_alsa.cpp:466: undefined reference tosnd_pcm_close' permrec_audio-as_alsa.o: In function AudioSourceALSA::QueryFormat(AudioFormat&)': /home/kg/Software/permanentrecord/as_alsa.cpp:308: undefined reference tosnd_pcm_hw_params_test_format' /home/kg/Software/permanentrecord/as_alsa.cpp:359: undefined reference to snd_pcm_hw_params_set_format' /home/kg/Software/permanentrecord/as_alsa.cpp:371: undefined reference tosnd_pcm_hw_params_set_channels' /home/kg/Software/permanentrecord/as_alsa.cpp:374: undefined reference to snd_pcm_hw_params_get_channels' /home/kg/Software/permanentrecord/as_alsa.cpp:466: undefined reference tosnd_pcm_close' /home/kg/Software/permanentrecord/as_alsa.cpp:440: undefined reference to snd_pcm_open' /home/kg/Software/permanentrecord/as_alsa.cpp:444: undefined reference tosnd_pcm_hw_params_malloc' /home/kg/Software/permanentrecord/as_alsa.cpp:448: undefined reference to snd_pcm_hw_params_any' /home/kg/Software/permanentrecord/as_alsa.cpp:452: undefined reference tosnd_pcm_hw_params_set_access' /home/kg/Software/permanentrecord/as_alsa.cpp:462: undefined reference to snd_pcm_hw_params_free' /home/kg/Software/permanentrecord/as_alsa.cpp:466: undefined reference tosnd_pcm_close' /home/kg/Software/permanentrecord/as_alsa.cpp:462: undefined reference to snd_pcm_hw_params_free' /home/kg/Software/permanentrecord/as_alsa.cpp:375: undefined reference tosnd_pcm_hw_params_get_rate' /home/kg/Software/permanentrecord/as_alsa.cpp:376: undefined reference to snd_pcm_hw_params_get_format' /home/kg/Software/permanentrecord/as_alsa.cpp:326: undefined reference tosnd_pcm_hw_params_test_format' /home/kg/Software/permanentrecord/as_alsa.cpp:364: undefined reference to snd_pcm_hw_params_set_rate_near' /home/kg/Software/permanentrecord/as_alsa.cpp:462: undefined reference tosnd_pcm_hw_params_free' /home/kg/Software/permanentrecord/as_alsa.cpp:466: undefined reference to snd_pcm_close' permrec_audio-as_alsa.o: In functionAudioSourceALSA::EnumDevices(std::vector<AudioDevicePair, std::allocator >&)': /home/kg/Software/permanentrecord/as_alsa.cpp:74: undefined reference to snd_device_name_hint' /home/kg/Software/permanentrecord/as_alsa.cpp:77: undefined reference tosnd_device_name_get_hint' /home/kg/Software/permanentrecord/as_alsa.cpp:78: undefined reference to snd_device_name_get_hint' /home/kg/Software/permanentrecord/as_alsa.cpp:79: undefined reference tosnd_device_name_get_hint' /home/kg/Software/permanentrecord/as_alsa.cpp:116: undefined reference to snd_device_name_free_hint' permrec_audio-as_pulse.o: In functionpulse_idle()': /home/kg/Software/permanentrecord/as_pulse.cpp:41: undefined reference to pa_mainloop_prepare' /home/kg/Software/permanentrecord/as_pulse.cpp:42: undefined reference topa_mainloop_poll' permrec_audio-as_pulse.o: In function pulse_open_global_connect()': /home/kg/Software/permanentrecord/as_pulse.cpp:51: undefined reference topa_context_connect' /home/kg/Software/permanentrecord/as_pulse.cpp:61: undefined reference to pa_context_get_state' permrec_audio-as_pulse.o: In functionpulse_open_global()': /home/kg/Software/permanentrecord/as_pulse.cpp:92: undefined reference to pa_context_new' /home/kg/Software/permanentrecord/as_pulse.cpp:84: undefined reference topa_mainloop_new' /home/kg/Software/permanentrecord/as_pulse.cpp:88: undefined reference to pa_mainloop_get_api' permrec_audio-as_pulse.o: In functionpulse_close_global()': /home/kg/Software/permanentrecord/as_pulse.cpp:105: undefined reference to pa_context_disconnect' /home/kg/Software/permanentrecord/as_pulse.cpp:106: undefined reference topa_context_unref' /home/kg/Software/permanentrecord/as_pulse.cpp:110: undefined reference to pa_signal_done' /home/kg/Software/permanentrecord/as_pulse.cpp:111: undefined reference topa_mainloop_free' permrec_audio-as_pulse.o: In function pulse_idle()': /home/kg/Software/permanentrecord/as_pulse.cpp:43: undefined reference topa_mainloop_dispatch' permrec_audio-as_pulse.o: In function AudioSourcePULSE::Close()': /home/kg/Software/permanentrecord/as_pulse.cpp:449: undefined reference topa_stream_flush' /home/kg/Software/permanentrecord/as_pulse.cpp:450: undefined reference to pa_stream_unref' permrec_audio-as_pulse.o: In functionAudioSourcePULSE::~AudioSourcePULSE()': /home/kg/Software/permanentrecord/as_pulse.cpp:449: undefined reference to pa_stream_flush' /home/kg/Software/permanentrecord/as_pulse.cpp:450: undefined reference topa_stream_unref' /home/kg/Software/permanentrecord/as_pulse.cpp:449: undefined reference to pa_stream_flush' /home/kg/Software/permanentrecord/as_pulse.cpp:450: undefined reference topa_stream_unref' permrec_audio-as_pulse.o: In function AudioSourcePULSE::~AudioSourcePULSE()': /home/kg/Software/permanentrecord/as_pulse.cpp:449: undefined reference topa_stream_flush' /home/kg/Software/permanentrecord/as_pulse.cpp:450: undefined reference to pa_stream_unref' /home/kg/Software/permanentrecord/as_pulse.cpp:449: undefined reference topa_stream_flush' /home/kg/Software/permanentrecord/as_pulse.cpp:450: undefined reference to pa_stream_unref' permrec_audio-as_pulse.o: In functionAudioSourcePULSE::SelectDevice(char const)': /home/kg/Software/permanentrecord/as_pulse.cpp:449: undefined reference to pa_stream_flush' /home/kg/Software/permanentrecord/as_pulse.cpp:450: undefined reference topa_stream_unref' permrec_audio-as_pulse.o: In function `AudioSourcePULSE::Read(void, unsigned int)': /home/kg/Software/permanentrecord/as_pulse.cpp:272: undefined reference to pa_stream_peek' /home/kg/Software/permanentrecord/as_pulse.cpp:285: undefined reference topa_stream_drop' permrec_audio-as_pulse.o: In function AudioSourcePULSE::Open()': /home/kg/Software/permanentrecord/as_pulse.cpp:415: undefined reference topa_stream_new' /home/kg/Software/permanentrecord/as_pulse.cpp:419: undefined reference to pa_stream_connect_record' /home/kg/Software/permanentrecord/as_pulse.cpp:430: undefined reference topa_stream_get_state' /home/kg/Software/permanentrecord/as_pulse.cpp:449: undefined reference to pa_stream_flush' /home/kg/Software/permanentrecord/as_pulse.cpp:450: undefined reference topa_stream_unref' permrec_audio-as_pulse.o: In function AudioSourcePULSE::EnumDevices(std::vector<AudioDevicePair, std::allocator<AudioDevicePair> >&)': /home/kg/Software/permanentrecord/as_pulse.cpp:176: undefined reference topa_context_get_source_info_list' /home/kg/Software/permanentrecord/as_pulse.cpp:182: undefined reference to pa_operation_get_state' permrec_audio-as_pulse.o: In functionAudioSourcePULSE::QueryFormat(AudioFormat&)': /home/kg/Software/permanentrecord/as_pulse.cpp:449: undefined reference to pa_stream_flush' /home/kg/Software/permanentrecord/as_pulse.cpp:450: undefined reference topa_stream_unref' /home/kg/Software/permanentrecord/as_pulse.cpp:415: undefined reference to pa_stream_new' /home/kg/Software/permanentrecord/as_pulse.cpp:419: undefined reference topa_stream_connect_record' /home/kg/Software/permanentrecord/as_pulse.cpp:430: undefined reference to pa_stream_get_state' /home/kg/Software/permanentrecord/as_pulse.cpp:449: undefined reference topa_stream_flush' /home/kg/Software/permanentrecord/as_pulse.cpp:450: undefined reference to pa_stream_unref' /home/kg/Software/permanentrecord/as_pulse.cpp:449: undefined reference topa_stream_flush' /home/kg/Software/permanentrecord/as_pulse.cpp:450: undefined reference to pa_stream_unref' permrec_audio-as_pulse.o: In functionAudioSourcePULSE::SetFormat(AudioFormat const&)': /home/kg/Software/permanentrecord/as_pulse.cpp:449: undefined reference to pa_stream_flush' /home/kg/Software/permanentrecord/as_pulse.cpp:450: undefined reference topa_stream_unref' /home/kg/Software/permanentrecord/as_pulse.cpp:415: undefined reference to pa_stream_new' /home/kg/Software/permanentrecord/as_pulse.cpp:419: undefined reference topa_stream_connect_record' /home/kg/Software/permanentrecord/as_pulse.cpp:430: undefined reference to pa_stream_get_state' /home/kg/Software/permanentrecord/as_pulse.cpp:449: undefined reference topa_stream_flush' /home/kg/Software/permanentrecord/as_pulse.cpp:450: undefined reference to pa_stream_unref' /home/kg/Software/permanentrecord/as_pulse.cpp:449: undefined reference topa_stream_flush' /home/kg/Software/permanentrecord/as_pulse.cpp:450: undefined reference to pa_stream_unref' collect2: error: ld returned 1 exit status make[1]: *** [permrec_audio] Error 1 make: *** [all] Error 2

Running Ubuntu MATE 18.04 with kernel 4.15.0-43, incidentally.

joncampbell123 commented 5 years ago

In the Makefile it generated, what are the ALSA_LIBS and PULSE_LIBS values?

Clearly the linker is not being given the right libraries to link to.

EDIT: I see the final link stage is being given the -lpulse and -lasound libraries, yet it's not finding them??

Are the ALSA and Pulse developer packages installed?

KGOrphanides commented 5 years ago
ACLOCAL = ${SHELL} /home/kg/Software/permanentrecord/missing aclocal-1.15
ALSA_CFLAGS = -I/usr/include/alsa
ALSA_LIBS = -lasound
...
PULSE_LIBS = -lpulse

I would guess that this is not as it should be?

Per apt: libpulse-dev is already the newest version (1:11.1-1ubuntu7.1). libasound2-dev is already the newest version (1.1.3-5ubuntu0.1). I also installed the i386 versions of both on the off-chance, but to no effect.

joncampbell123 commented 5 years ago

Where are those libraries installed?

Perhaps they're not installed in a location the linker expects to search?

This is very odd.

joncampbell123 commented 5 years ago

I am installing Ubuntu MATE in a virtual machine to see if I can recreate the issue.

joncampbell123 commented 5 years ago

Aargh why doesn't Ubuntu MATE support pkg-config?

The configure script needs pkg-config and the M4 macro to detect alsa and libpulse.

joncampbell123 commented 5 years ago

Okay help me out here. What are the magic apt-get install incantations to install the ALSA and PulseAudio headers so that one can, you know, compile against the libraries?

Most Linux distributions let you "apt-get install something-dev" to do this, but not Ubuntu.

EDIT: Okay, On Ubuntu you add -source, but there's still none for ALSA.

joncampbell123 commented 5 years ago

Okay, so for whatever reason, Ubuntu MATE doesn't put the libpulse libraries needed in /usr/lib or /usr/local/lib, it puts it off into something like /usr/lib/x86_64-linux-gnu.

EDIT: Apparently it won't link against libpulse.so EVEN IF YOU PUT THE FULL PATH RIGHT THERE IN THE LINKER FLAGS. objdump -T shows that the symbols ARE THERE.

joncampbell123 commented 5 years ago

sudo apt-get install autoconf automake m4 alsa alsa-base pulseaudio pulseaudio-source gcc g++

It installs GCC 7.3.x

joncampbell123 commented 5 years ago

I'm sorry but I'm at a loss how the linker can find libpulse.so, link to it, then complain it can't find the dynamic symbols that are obviously RIGHT THERE in the .so file.