I've been trying to determine if my Ubuntu (linux) system has -static libraries. When would they be located, and what suffix would identify them?
On debian-derived systems like Ubuntu, the static libraries that come with the system (installed by
dpkg, not by hand) usually go in
/usr/lib/<target-triplet>/ and have the suffix
Example, on my x86-64 debian system:
$ ls /usr/lib/x86_64-linux-gnu/*.a /usr/lib/x86_64-linux-gnu/libBrokenLocale.a /usr/lib/x86_64-linux-gnu/libFS.a /usr/lib/x86_64-linux-gnu/libGLU.a /usr/lib/x86_64-linux-gnu/libICE.a /usr/lib/x86_64-linux-gnu/libImlib2.a ...
apt-get install <package>-dev will usually install such libraries in addition to the dynamic
There are still packages which install their libraries directly under
/usr/lib though, eg. libgraphicsmagick1-dev.
clang will also install some "internal" libraries (
libstdc++, etc) under
Other distros may follow different conventions; for instance, in rhel/centos, all the development libraries go under
/usr/lib32/ and they're provided by
<package>-devel-*. Compiling a file with
gcc -v will always tell you where exactly the compiler is looking for libraries, whether static or dynamic.