C语言 什么是 *-devel 包?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2358801/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-02 04:42:08  来源:igfitidea点击:

What are *-devel packages?

c

提问by Variance

What is the utility of devel packages like "libgtk+-devel" or "python-devel" etc.? Do they contain source of the library? How is it different from non-devel packages like libgtk+?

“libgtk+-devel”或“python-devel”等开发包的用途是什么?它们是否包含库的来源?它与 libgtk+ 等非开发包有何不同?

回答by Joachim Sauer

The *-develpackages (usually called *-devin Debian-based distributions) are usually all the files necessary to compile code against a given library.

这些*-devel包(通常*-dev在基于 Debian 的发行版中被称为)通常是针对给定库编译代码所需的所有文件。

For running an application using the library libfooonly the actualy shared library file (*.so.*, for example libfoo.so.1.0) are needed (plus possibly some data files and some version-specific symlinks).

要使用库运行应用程序,libfoo只需要实际共享库文件(*.so.*例如libfoo.so.1.0)(可能还需要一些数据文件和一些特定于版本的符号链接)。

When you actually want to compile a C application that uses that library you'll need the header files (*.h, for example foo.h) that describe the interface of that application as well as a version-less symlink to the shared library (*.so, for example libfoo.so-> libfoo.so.1.0). Those are usually bundled in the *-develpackages.

当您真正想要编译使用该库的 C 应用程序时,您将需要描述该应用程序接口的头文件(*.h例如foo.h)以及指向共享库的无版本符号链接(*.so例如libfoo.so-> libfoo.so.1.0)。这些通常捆绑在*-devel包中。

Sometimes the *-develpackages also include statically compiled versions of the libraries (*.a, for example libfoo.a) in case you want to build a complete stand-alone application that doesn't depend on dynamic libraries at all.

有时,*-devel包还包括库的静态编译版本(*.a例如libfoo.a),以防您想构建完全不依赖于动态库的独立应用程序。

Other languages (such as Java, Python, ...) use a different way of noting the API of a library (effectively including all the necessary information in the actual library) and thus usually need no separate *-develpackages (except maybe for documentation and additional tools).

其他语言(例如 Java、Python 等)使用不同的方式来记录库的 API(有效地包括实际库中的所有必要信息),因此通常不需要单独的*-devel包(可能除了文档和附加包)工具)。

回答by AndiDog

They usually contain necessary headers and libraries. For example, python-devel will provide the Python headers and libraries that you need if you want to embed the Python interpreter in your own application. Some additional tools and documentation are included, too (e.g. a developer manual or code examples).

它们通常包含必要的头文件和库。例如,如果您想在自己的应用程序中嵌入 Python 解释器,python-devel 将提供您需要的 Python 头文件和库。还包括一些额外的工具和文档(例如开发人员手册或代码示例)。