我可以为我的程序的 Linux 二进制文件提供我系统的共享库吗?

发布于 2024-12-22 01:16:11 字数 1455 浏览 2 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

神也荒唐 2024-12-29 01:16:11

分发二进制文件的最佳方法是使用免费许可证以源代码形式发布程序(例如 GPL);那么发行版制作者(和贡献者)最终将打包您的程序以进行发行(您不必为此烦恼)。

否则,您可以为一些主要的 Linux 发行版分发二进制包(例如,.deb 用于 Debian 或 Ubuntu,.rpm 用于 Redhat、Centos 或 Mandriva)。

一些非自由软件(例如用于驱动 ATI 显卡的 AMD/ATI Catalyst fglrx)以生成适当的二进制包(在最终用户计算机上)的形式分发。

您提到的所有库都可以在每个标准的不太旧的 Linux 发行版中使用。您不需要分发它们,只需提及您需要它们(并给出它们的精确列表及其版本号)。

我真的会避免[重新]分发系统库,例如libc.so.6libstdc++.so.6;避免分发它们的主要原因是您的用户(在他的系统上安装您的副本)很可能会在他自己的系统上造成大混乱(这可能会破坏其他现有程序,这会让您的用户生气)。当然,如果您选择(在我看来是错误的)分发它们,则必须遵守他们的许可证。但您的用户已经拥有它们,并且通过重新分发它们,您会增加出现大混乱的可能性。因此,只需提供程序的二进制可执行文件(适当打包),而不需要它所需的系统库。

所有包管理器(和包格式)都会处理依赖关系(对其他包的依赖),因此在极少数情况下,当用户的系统还没有安装libstdc++.so.6时,就会安装它。

The best way to distribute binaries is to publish your program in source form with a free license (like GPL); then distribution makers (and contributors) will eventually package your program for their distribution (and you don't have to bother with that).

Otherwise, you could distribute binary packages for some few major Linux distributions (eg .debfor Debian or Ubuntu with .rpm for Redhat or Centos or Mandriva).

Some non-free software (like AMD/ATI Catalyst fglrx for driving ATI graphics card) are distributed in a form which generates appropriate binary packages (on the end-user machine).

All the libraries you mention are available in every standard not too old Linux distribution. You don't need to distribute them, just mention that you need them (and give a precise list of them, with their version number).

I would really avoid  [re-] distributing the system libraries like libc.so.6 or libstdc++.so.6; the main reason to avoid distributing them is that your user (installing your copies on his system) will very probably make a big mess on his own system (and that could break other existing programs, which will make your user pissed off). Of course, if you choose (wrongly in my opinion) to distribute them, you have to comply with their license. But your users already have them, and by re-distributing them you increase the probability of a big mess. So just give the binary executable of your program (suitably packaged), without the system libraries that it requires.

All package managers (and package formats) deal with dependencies (on other packages), so will install e.g. libstdc++.so.6 in the rare cases when the user's system don't have it already.

属性 2024-12-29 01:16:11

您不应该重新分发这 5 个库,因为大多数现代 Linux 系统已经提供了它们。如果您决定重新分发它们,无论如何,您还需要提供它们的来源;阅读 LGPL(或摘要)了解详细信息。

You should not redistribute those 5 libraries as most modern Linux systems will already have them available. Should you decide to redistribute them regardless, you would also be required to make their source available; read the LGPL (or a summary) for details.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文