SFML 未静态链接到 openal32(静态链接到所有其他依赖项)

SFML not linking statically to openal32 (links statically to all other dependencies)

我使用 CMake 为 MinGW 编译了 SFML。在 运行 "mingw32-make install" 之后,一切都已构建和安装,没有错误。但是当 运行 的例子 - pong.exe, sound.exe, sound-capture.exe 和 voip.exe 都依赖于 openal32.dll.

我在配置 CMake 时指定了 SFML_USE_STATIC_LIBS = true,示例可执行文件的所有其他依赖项仅依赖于本机 windows dll。

谁能解释为什么它动态链接到 openal32(但没有别的)?

编辑: 我刚看到这个线程 http://en.sfml-dev.org/forums/index.php?topic=262.0,它讨论的是完全相同的问题。我本以为(因为这是从 2008 年开始的)现在已经实施了。还是还是一样的情况?

编辑 2: 此处的响应 http://en.sfml-dev.org/forums/index.php?topic=18119.0 表明由于许可证的原因,OpenAL 必须动态链接。谁能确认许可证是否允许 openal32.dll 与可执行文件一起分发?

我不是律师(昨晚也没有入住热门连锁酒店)

OpenAL implementation they are using is licensed under the GNU Library General Public License (LGPL), version 2。 LGPL v2 要求:

If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights.

允许用户重新link具有修改的 OpenAL 库的闭源游戏的最简单方法是 link 动态地制作该游戏openal32.dll。这样,他们就可以简单地用修改后的 openal32.dll 换出,并将其放在您的游戏可执行文件旁边。

关于这部分许可证:

And you must show them these terms so they know their rights.

只需告知您的用户您的游戏使用 OpenAL,并以某种方式让他们访问 LGPL v2 文本的正文。

在以下条件下,您可以随游戏一起分发 openal32.dll

For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code.

这可以通过简单地告知您的用户您的游戏使用 OpenAL 并提供 link 他们可以下载源代码的位置来实现。

要告知您的用户他们对 OpenAL 的权利,您可以在游戏本身的 "About" 页面或分发的游戏手册的 preface/appendix 中进行。例如:

This game uses the following open-source software:

在告知用户 OpenAL 的同时,您还可以自愿提供游戏使用的其他开源库的归属,例如 SFML。