【发布时间】:2014-02-25 21:10:01
【问题描述】:
我正在尝试运行 spotify 示例。我已经成功编译了它们,但我无法运行任何东西。当即执行 ./jukebox.o 时,它只会说“无法执行二进制文件”。如何运行示例?
这是我做的时候得到的:
libspotify/examples$ 使 LIBSPOTIFY_PATH=../../../..
对于点唱机中的 spshell 本地文件;做 -C $a LIBSPOTIFY_PATH="/home/alexander/slask/libspotify-12.1.51-Linux-x86_64-release" all;完毕
make[1]: 进入目录/home/alexander/slask/libspotify-12.1.51-Linux-x86_64-release/share/doc/libspotify/examples/jukebox'
cc -I/usr/include/alsa -I/home/alexander/slask/libspotify-12.1.51-Linux-x86_64-release/include -Wall -Wl,-rpath,/home/alexander/slask/libspotify-12.1.51-Linux-x86_64-release/lib -L/home/alexander/slask/libspotify-12.1.51-Linux-x86_64-release/lib jukebox.o appkey.o alsa-audio.o audio.o -o jukebox -lasound -lspotify
/usr/bin/ld: alsa-audio.o: undefined reference to symbol 'pthread_create@@GLIBC_2.2.5'
/lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[1]: *** [jukebox] Error 1
make[1]: Leaving directory/home/alexander/slask/libspotify-12.1.51-Linux-x86_64-release/share/doc/libspotify/examples/jukebox'
make[1]: 进入目录/home/alexander/slask/libspotify-12.1.51-Linux-x86_64-release/share/doc/libspotify/examples/spshell'
cc -I/home/alexander/slask/libspotify-12.1.51-Linux-x86_64-release/include -Wall -Wl,-rpath,/home/alexander/slask/libspotify-12.1.51-Linux-x86_64-release/lib -L/home/alexander/slask/libspotify-12.1.51-Linux-x86_64-release/lib spshell.o spshell_posix.o appkey.o cmd.o browse.o search.o toplist.o inbox.o star.o playlist.o test.o -lreadline -lspotify -o spshell
/usr/bin/ld: spshell_posix.o: undefined reference to symbol 'pthread_create@@GLIBC_2.2.5'
/lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[1]: *** [spshell] Error 1
make[1]: Leaving directory/home/alexander/slask/libspotify-12.1.51-Linux-x86_64-release/share/doc/libspotify/examples/spshell'
make[1]: 进入目录/home/alexander/slask/libspotify-12.1.51-Linux-x86_64-release/share/doc/libspotify/examples/localfiles'
make[1]: Leaving directory/home/alexander/slask/libspotify-12.1.51-Linux-x86_64-release/share/doc/libspotify/examples/localfiles'
【问题讨论】:
-
您使用的是什么操作系统,您是如何构建示例的? “jukebox.o”听起来像是一个目标文件,而不是可执行文件,因此您可能已经编译了它但没有链接它。
-
我使用 Makefile 编译它。运行 Ubuntu 64 位。
标签: c spotify libspotify