首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >运行libspotify示例

运行libspotify示例
EN

Stack Overflow用户
提问于 2014-02-26 05:10:02
回答 3查看 889关注 0票数 1

我正在尝试运行spotify示例。我已经成功地编译了它们,但是我不能运行任何东西。如果是do./jukebox.o,它只会说“无法执行二进制文件”。如何运行这些示例?

这是我在做的时候得到的:

libspotify/examples$ make LIBSPOTIFY_PATH=../..对于光盘机中的spshell本地文件,请务必使LIBSPOTIFY_PATH="/home/alexander/slask/libspotify-12.1.51-Linux-x86_64-release“-C $a all;完成make1:进入目录/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‘make1:进入目录/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’make1:进入目录/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‘

EN

回答 3

Stack Overflow用户

发布于 2014-05-08 19:43:27

我在64位的Ubuntu上也遇到了类似的问题。编辑examples/common.mk中的LDLIBS行,如下所示

代码语言:javascript
复制
LDLIBS  += -lspotify -lpthread -ldl
票数 3
EN

Stack Overflow用户

发布于 2014-02-26 06:34:04

您必须使文件成为可执行文件。

试试chmod u+x jukebox.o,如果不起作用,你应该试着像编译gcc那样编译它。c -o jukebox

票数 0
EN

Stack Overflow用户

发布于 2014-02-26 17:34:58

在Linux上,成功运行makefile后,您的share/doc/libspotify/examples/jukebox目录应该如下所示:

代码语言:javascript
复制
weeble@mylaptop:~/prj/libspotify/libspotify-12.1.51-Linux-i686-release/share/doc/libspotify/examples$ ls -l jukebox/
total 140
-rw-r--r-- 1 weeble weeble  5588 Jun 13  2012 alsa-audio.c
-rw-r--r-- 1 weeble weeble  5392 Feb 26 09:25 alsa-audio.o
-rw-r--r-- 1 weeble weeble   856 Feb 26 09:26 appkey.o
-rw-r--r-- 1 weeble weeble  1840 Jun 13  2012 audio.c
-rw-r--r-- 1 weeble weeble  1828 Jun 13  2012 audio.h
-rw-r--r-- 1 weeble weeble  1400 Feb 26 09:25 audio.o
-rw-r--r-- 1 weeble weeble  1718 Jun 13  2012 dummy-audio.c
-rwxr-xr-x 1 weeble weeble 21865 Feb 26 09:26 jukebox
-rw-r--r-- 1 weeble weeble 15156 Jun 13  2012 jukebox.c
-rw-r--r-- 1 weeble weeble  9116 Feb 26 09:19 jukebox.o
-rw-r--r-- 1 weeble weeble  1051 Jun 13  2012 Makefile
-rw-r--r-- 1 weeble weeble  4469 Jun 13  2012 openal-audio.c
drwxr-xr-x 3 weeble weeble  4096 Jun 13  2012 osx
-rw-r--r-- 1 weeble weeble  3378 Jun 13  2012 osx-audio.c
-rw-r--r-- 1 weeble weeble  8860 Jun 13  2012 playtrack.c
-rw-r--r-- 1 weeble weeble 18990 Jun 13  2012 queue.h

可执行文件是名为"jukebox“的文件。所以运行"./jukebox/jukebox“。如果该文件不在那里,则可能构建过程失败。当你运行"make“的时候有没有什么消息或者警告?

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/22026249

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档