[英]Compiling program in C
this is my first question here.这是我在这里的第一个问题。 I have been compiling a Debian package in C ( emacs ).
我一直在用 C ( emacs ) 编译一个 Debian 包。 It is also my first compilation, so I don't understand much about it (until now).
这也是我第一次编译,所以我对它了解不多(直到现在)。
I have the following structure:我有以下结构:
/home/user/emacs
./home/user/emacs
包含编译所需的所有文件(提取 tar.gz 源代码包的结果)的文件夹。make install
in /opt/emacs
(because I specified that path while doing the ./configure
, in the --prefix
argument)./opt/emacs
使用make install
程序的文件夹(因为我在执行./configure
时在--prefix
参数中指定了该路径)。 As you all know, Linux uses a $PATH
variable where all the paths that Linux should use to search for binaries are specified.众所周知,Linux 使用
$PATH
变量,其中指定了 Linux 用于搜索二进制文件的所有路径。 By default, /opt/emacs/bin
is obviusly not contemplated in that variable, and it is not an option for me to include it.默认情况下,
/opt/emacs/bin
显然没有考虑在该变量中,并且我不能选择包含它。 The possible solution that I've heard about is to create a softlink in /usr/local/bin
folder, which aims to that /opt/emacs/bin/*
files.我听说过的可能解决方案是在
/usr/local/bin
文件夹中创建一个软链接,其目标是/opt/emacs/bin/*
文件。
Here comes my question.我的问题来了。 That
/opt/emacs
also has a lib/
subdirectory. /opt/emacs
也有一个lib/
子目录。 Would it be needed to also create a softlink for those libraries in /usr/local/lib
for emacs to correctly work, or with the binary softlink is enough?是否还需要为
/usr/local/lib
那些库创建软链接以使 emacs 正常工作,或者使用二进制软链接就足够了?
Thank you so much.非常感谢。
Not sure if emacs only needs the binary symlink or the library directory as well.不确定 emacs 是否只需要二进制符号链接或库目录。 Try running it.
尝试运行它。 If it needed the libraries and cannot find them, it will fall over rather quickly.
如果它需要库而找不到它们,它会很快崩溃。
Let's assume that the libraries are needed.让我们假设需要这些库。 You have several options for installing them (choose at most one):
您有多种安装选项(最多选择一个):
ldconfig
afterwards.ldconfig
。 On second thoughts, don't do this one, it's the worst option./etc/ld.so.conf
to add the emacs library directory there, run ldconfig
/etc/ld.so.conf
以在那里添加 emacs 库目录,运行ldconfig
LD_LIBRARY_PATH
to its lib directory and then runs itLD_LIBRARY_PATH
设置为其 lib 目录的 shellscript 启动 emacs,然后运行它For more in-depth details see https://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html有关更深入的详细信息,请参阅https://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.