gpt4 book ai didi

ubuntu - 无法使用 UFFI 加载 libncurses

转载 作者:太空宇宙 更新时间:2023-11-03 18:54:47 26 4
gpt4 key购买 nike

我正在使用 quicklisp 安装的 cl-ncurses 在 Ubuntu 13.04 上运行从 apt 安装的 SBCL,我遇到了通过 UFFI 加载 native ncurses 的问题。

初始 session 是这样的:

This is SBCL 1.1.1.0.debian, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://www.sbcl.org/>.

SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses. See the CREDITS and COPYING files in the
distribution for more information.
\* (asdf:oos 'asdf:load-op :cl-ncurses)
WARNING: Unable to load ncurses.

这是正确的,因为尝试运行 ncurses 相关代码会产生:

debugger invoked on a SB-KERNEL::UNDEFINED-ALIEN-FUNCTION-ERROR in thread
#<THREAD "main thread" RUNNING {10029C0E83}>:
Attempt to call an undefined alien function.

Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
0: [ABORT] Exit debugger, returning to top level.

(SB-KERNEL::UNDEFINED-ALIEN-FUNCTION-ERROR)

如果我尝试手动加载它(从 cl-ncurse 的 package.lisp 中窃取相关代码),我得到以下结果:

\* (asdf:load-system 'uffi)

T
\* (uffi:find-foreign-library "libncurses" '("/usr/local/lib64/" "/usr/local/lib/" "/lib64/" "/lib/" "/usr/lib64/" "/usr/lib/" "/usr/lib32" "/usr/lib/x86_64-linux-gnu") :types '("so" "a"))

NIL

我在其中添加了最后两个搜索路径。 libncurses5-dev 已安装且应用程序正在运行在 ncurses 上运行良好。试图在我的机器上找到 .so 文件,我得到:

% locate libncurses.so
/lib/i386-linux-gnu/libncurses.so.5
/lib/i386-linux-gnu/libncurses.so.5.9
/lib/x86_64-linux-gnu/libncurses.so.5
/lib/x86_64-linux-gnu/libncurses.so.5.9
/lib32/libncurses.so.5
/lib32/libncurses.so.5.9
/usr/lib/x86_64-linux-gnu/libncurses.so
/usr/lib32/libncurses.so

到达 libncurses.so 的路径包含在搜索路径中。关于如何让 UFFI 加载 ncurses 有什么想法吗?

最佳答案

我最终通过添加一个符号链接(symbolic link)来实现它,如下所示:

% sudo ln -s /lib/x86_64-linux-gnu/libncurses.so.5.9 /usr/lib/libncurses.so 

对 64 位版本而不是 32 位版本进行符号链接(symbolic link)很重要。这个想法来自这个 github 页面:

https://github.com/chadbraunduin/hackernews

关于ubuntu - 无法使用 UFFI 加载 libncurses,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17416504/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com