Tag Info

New answers tagged

1

You just need to add a newline character at the end of the last line of your *.h files. According to the ANSI standard the #include of a file at the beginning inserts the file exactly as it is to the front of the file and does not insert the new line after the #include after the contents of the file. So if you include a file with no newline at the end to ...


2

Another way to get it: getconf GNU_LIBC_VERSION


4

The obvious answer, though not the most comprehensive, is to check your package manager, e.g rpm -qi glibc dpkg -l libc6 (Sadly, glibc doesn't have a pkconfig .pc file, so pkgconfig --modversion glibc is a non-runner.) See also @Gnouc's excellent getconf suggestion. The simplest case, with gcc+glibc, and the one I mostly use first is to just execute ...


4

(This is essentially the same as goldilocks' answer but with some more explanation of what is going on under the hood.) The core shared library for GNU libc, libc.so.6 (on Linux; Hurd has a different SONAME), has the unusual property (for shared libraries) that you can invoke it as an executable. If you do, it prints out the sort of thing GNU utilities ...


7

A system isn't actually limited to one C library. Most, though, primarily use only one, which will also be the one the default compiler uses. And since you're downloading source code to compile, that's the one you're concerned with. Start with a trivial program: #include <stdio.h> int main() { printf("Hello, world\n"); return 0; } compile ...


4

GNU libc (what most Linux distributions use in one form or the other) goes to great lengths to keep strict backwards compatibility. So you should run into trouble only if you try to run a too-new binary on an old version (or a "enterprise" distribution, they normally freeze versions, particularly foundation ones like the C library, backporting fixes while ...


14

GNU/Linux systems usually use either glibc (Fedora/Redhat family, Arch) or its close cousin, eglibc (Debian/Ubuntu family); since eglibc is now being merged back into glibc (see EGLIBC 2.19 Branch Created under "News"), in the near future they will all be glibc again. The easiest way to check the exact version is to ask ldd, which ships with the C library. ...



Top 50 recent answers are included