我正在尝试运行spotify示例。我已经成功地编译了它们,但是我不能运行任何东西。当i.e.do./jukebox.o时,它只是说“无法执行二进制文件”。如何运行示例?
这就是我做的时候得到的:
libspotify/examples$make libspotify_PATH=../../。。
对于光盘机中的spshell localfiles;请将-C$a LIBSPOTIFY路径=“/home/alexander/slask/LIBSPOTIFY-12.1.51-Linux-x86\u 64-release”全部设置为;完成
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 linecollect2: error: ld returned 1 exit statusmake[1]: *** [jukebox] Error 1make[1]: Leaving directory
/home/alexander/slask/libspotify-12.1.51-Linux-x86-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 linecollect2: error: ld returned 1 exit statusmake[1]: *** [spshell] Error 1make[1]: Leaving directory
/home/alexander/slask/libspotify-12.1.51-Linux-x86-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-release/share/doc/libspotify/examples/localfiles'
最佳答案
我在64位Ubuntu上也遇到了类似的问题。在examples/common.mk中编辑LDLIBS行,如下所示
LDLIBS += -lspotify -lpthread -ldl