2016-09-19 3 views
0

Я пытаюсь перекрестно скомпилировать приложение ALSA Lib для Linux-манипулятора. Я использую eclipse для сборки для меня. Фаза сборки приложения успешна, но я получаю ошибки, когда gcc-линкер пытается завершить.ALSA Lib 1.1.2 Ошибка компиляции

я получаю следующие ошибки

Building target: sound Invoking: 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: In function main': /home/neonws/sound/Debug/../play.c:13: undefined reference to snd_pcm_open' makefile:29: recipe for target 'sound' failed /home/neonws/sound/Debug/../play.c:14: undefined reference to snd_strerror' /home/neonws/sound/Debug/../play.c:20: undefined reference to snd_pcm_hw_params_malloc' /home/neonws/sound/Debug/../play.c:21: undefined reference to snd_strerror' /home/neonws/sound/Debug/../play.c:26: undefined reference to snd_pcm_hw_params_any' /home/neonws/sound/Debug/../play.c:27: undefined reference to 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: undefined reference to 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: undefined reference to 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: undefined reference to 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: undefined reference to snd_strerror' /home/neonws/sound/Debug/../play.c:56: undefined reference to snd_pcm_hw_params' /home/neonws/sound/Debug/../play.c:57: undefined reference to snd_strerror' /home/neonws/sound/Debug/../play.c:62: undefined reference to snd_pcm_hw_params_free' /home/neonws/sound/Debug/../play.c:64: undefined reference to snd_pcm_prepare' /home/neonws/sound/Debug/../play.c:65: undefined reference to snd_strerror' /home/neonws/sound/Debug/../play.c:71: undefined reference to snd_pcm_writei' /home/neonws/sound/Debug/../play.c:72: undefined reference to snd_strerror' /home/neonws/sound/Debug/../play.c:78: undefined reference to `snd_pcm_close' collect2: error: ld returned 1 exit status make: *** [sound] Error 1

11:15:58 отделкой (взял 75 мс)

Я использую Sample Playback Program от ASLA-LIB API.

Мне интересно, что приводит к сбою компоновщика?

ответ

0

Вам не хватает ссылки на библиотеку asound, добавьте -lasound к вашим связующим флагам (см. this question, где указано, где это сделать правильно в Eclipse). И, вероятно, удалите -L/proc/asound, я не думаю, что у вас там есть ваши библиотеки.

+0

> цель здания: звук Вызывающие: Кросс GCC Linker рычажного линукс-gnueabihf-НКА -L/дома/ALSA Пб-1.1.2/включает -L/SRV/NFS/корневой файловую систему/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 -lasound /home/gcc-linaro-5.2-2015.11-2-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/5.2.1/../../. ./../arm-linux-gnueabihf/bin/ld: не удается найти -lasound makefile: 29: рецепт для целевого «звука» не выполнен collect2: ошибка: ld вернулся 1 статус выхода сделать: *** [звук] Ошибка 1 14:18:14 Строительство закончено (взято 76ms) – JavaProgrammer

+0

Hi @Roman Я следовал указаниям, которые вы предложили, и это дало мне ошибки компоновщика, говоря «-lasound not found» Можете ли вы предложить решение для этого. Я добавил «asound» в Библиотеки (-l), за которым следует путь в пути поиска библиотеки (-L) для Linker. – JavaProgrammer

+0

@JavaProgrammer: трудно сказать, где находятся ваши библиотеки, теперь вы пропускаете библиотеку в пути поиска библиотеки, вы должны добавить правильный путь с параметром '-L'. Где у вас есть целевая корневая файловая система? –

Смежные вопросы