ALSA Lib 1.1.2 Ошибка компиляции
Я пытаюсь скомпилировать приложение ALSA Lib для процессора на базе Linux. Я использую затмение, чтобы сделать сборку для меня. Фаза сборки приложения прошла успешно, но я получаю ошибки, когда компоновщик gcc пытается завершить работу.
Я получаю следующие ошибки
Создание цели: звук Вызов: Cross GCC Linker arm-linux-gnueabihf-gcc -L / proc / asound -L / srv / nfs / rootfs / usr / lib -Wl, -rpath-link, / srv / nfs / rootfs / usr / lib -L / srv / nfs / rootfs / lib -Wl, -rpath-link, / srv / nfs / rootfs / lib -o "sound"./play.o
./play.o: в функцииmain': /home/neonws/sound/Debug/../play.c:13: undefined reference to
snd_pcm_open' makefile:29: рецепт для целевого' звука 'не выполнен /home/neonws/sound/Debug/../play.c:14: неопределенная ссылка наsnd_strerror' /home/neonws/sound/Debug/../play.c:20: undefined reference to
snd_pcm_hw_params_malloc' /home/neonws/sound/Debug/../play.c:21: неопределенная ссылка наsnd_strerror' /home/neonws/sound/Debug/../play.c:26: undefined reference to
snd_pcm_hw_params_any' /home/neonws/sound/Debug/../play.c:27: неопределенная ссылка наsnd_strerror' /home/neonws/sound/Debug/../play.c:32: undefined reference to
snd_pcm_hw_params_set_access' /home/neonws/sound/Debug/../play.c:33: неопределенная ссылка наsnd_strerror' /home/neonws/sound/Debug/../play.c:38: undefined reference to
snd_pcm_hw_params_set_format' /home/neonws/sound/Debug/../play.c:39: неопределенная ссылка наsnd_strerror' /home/neonws/sound/Debug/../play.c:44: undefined reference to
snd_pcm_hw_params_set_rate_near' /home/neonws/sound/Debug/../play.c:45: неопределенная ссылка наsnd_strerror' /home/neonws/sound/Debug/../play.c:50: undefined reference to
snd_pcm_hw_params_set_channels' /home/neonws/sound/Debug/../play.c:51: неопределенная ссылка наsnd_strerror' /home/neonws/sound/Debug/../play.c:56: undefined reference to
snd_pcm_hw_params' /home/neonws/sound/Debug/../play.c:57: неопределенная ссылка наsnd_strerror' /home/neonws/sound/Debug/../play.c:62: undefined reference to
snd_pcm_hw_params_free' /home/neonws/sound/Debug/../play.c:64: неопределенная ссылка наsnd_pcm_prepare' /home/neonws/sound/Debug/../play.c:65: undefined reference to
snd_strerror' /home/neonws/sound/Debug/../play.c:71: неопределенная ссылка наsnd_pcm_writei' /home/neonws/sound/Debug/../play.c:72: undefined reference to
snd_strerror' /home/neonws/sound/Debug/../play.c:78: неопределенная ссылка на `snd_pcm_close' collect2: ошибка: ld вернул 1 состояние выхода make: *** [sound] Error 1
11:15:58 Сборка завершена (заняло 75 мс)
Я использую программу воспроизведения сэмплов из API ASLA-LIB.
Мне интересно, что вызывает сбой компоновщика?
1 ответ
Вы скучаете по asound
связь с библиотекой, добавить -lasound
к вашим ссылочным флагам (см. этот вопрос, в котором рассказывается, как это сделать в Eclipse). И, вероятно, удалить -L/proc/asound
Я не думаю, что у вас есть ваши библиотеки там.