user2911983 user2911983 - 1 month ago 4
C++ Question

What exactly are development headers?

I'm confused about the use for "*-devel" packages, and so I looked it up. According to an answer in this post, What are *-devel packages?:

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

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 -> Those are usually bundled in the *-devel packages."

This seems redundant to me. To me it sounds like this: "To use the library you need just the libfoo. But if you want to use the library, you need the header files and hence libfoo-devel"

I can't quite find the answer to the importance of the header files.


After you built an application using libfoo, you obviously do not need any of libfoo's headers installed any more. The application is already compiled. You don't need the header files to run something that's already compiled. The only thing you need is libfoo itself, because your application is linked to it.

And that's your libfoo: just the library itself. Maybe an occasional configuration file, or something else, that's needed at runtime.

On the other hand, if you need to build and compile the source code that uses libfoo, you need the header files, and other supporting files. Whatever is needed to build the source code that uses libfoo.

And those bits are the ones that go into the libfoo-devel package. That's the stuff that's needed to build the source code that uses libfoo.