pyspotify编译ld错误

pyspotify编译ld错误

我正在尝试在我的 freebox delta 上安装 mopidy-spotify,它允许我安装 vm 并且基于 arm64
在出现许多问题之后,我已经设法使大部分依赖项正常工作并消除了大部分错误。
但在尝试编译 pyspotify 时,我仍然在 libspotify 上苦苦挣扎。我已经使用以下来源在我的系统上成功编译了(我认为)libspotify那个链接 但我总是得到

这是日志输出:

Obtaining file:///home/jc/pyspotify
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
    Preparing wheel metadata ... done
Requirement already satisfied: setuptools in /usr/lib/python3/dist-packages (from pyspotify==2.1.3) (45.2.0)
Requirement already satisfied: cffi>=1.0.0 in /usr/local/lib/python3.8/dist-packages (from pyspotify==2.1.3) (1.14.0)
Requirement already satisfied: pycparser in /usr/local/lib/python3.8/dist-packages (from cffi>=1.0.0->pyspotify==2.1.3) (2.20)
Installing collected packages: pyspotify
  Running setup.py develop for pyspotify
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/jc/pyspotify/setup.py'"'"'; __file__='"'"'/home/jc/pyspotify/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps
         cwd: /home/jc/pyspotify/
    Complete output (22 lines):
    running develop
    running egg_info
    writing pyspotify.egg-info/PKG-INFO
    writing dependency_links to pyspotify.egg-info/dependency_links.txt
    writing requirements to pyspotify.egg-info/requires.txt
    writing top-level names to pyspotify.egg-info/top_level.txt
    reading manifest file 'pyspotify.egg-info/SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    no previously-included directories found matching 'docs/_build'
    no previously-included directories found matching 'examples/tmp'
    warning: no previously-included files matching '__pycache__/*' found anywhere in distribution
    writing manifest file 'pyspotify.egg-info/SOURCES.txt'
    running build_ext
    generating cffi module 'build/temp.linux-aarch64-3.8/spotify._spotify.c'
    already up-to-date
    building 'spotify._spotify' extension
    aarch64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.8 -c build/temp.linux-aarch64-3.8/spotify._spotify.c -o build/temp.linux-aarch64-3.8/build/temp.linux-aarch64-3.8/spotify._spotify.o
    aarch64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fwrapv -O2 -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-aarch64-3.8/build/temp.linux-aarch64-3.8/spotify._spotify.o -lspotify -o build/lib.linux-aarch64-3.8/spotify/_spotify.abi3.so
    /usr/bin/ld: skipping incompatible /usr/local/lib/libspotify.so when searching for -lspotify
    /usr/bin/ld: cannot find -lspotify
    collect2: error: ld returned 1 exit status
    error: command 'aarch64-linux-gnu-gcc' failed with exit status 1

请随时询问更多信息,
有任何线索吗?

答案1

您很可能尝试混合使用 32 位和 64 位库。 32 位应用程序必须链接到 32 位库,而 64 位应用程序必须链接到 64 位库。

您可以运行file /usr/local/lib/libspotify.so来检查您的库是否已编译为 32 位或 64 位。

您可以通过设置以下环境变量来指示在 64 位系统上运行的 GCC 编译 32 位代码:

CFLAGS=-m32 CXXFLAGS=-m32 make

另请参阅/usr/bin/ld:搜索 foo 时跳过不兼容的 foo.so

相关内容