Guys, would you describe a few things about c++ building blocks, on unix.
I want to create an application that links against static libs and dynamic libs (.so).
<
Answer 1: To create a static library from source files foo.c and bar.c, do this:
gcc -c foo.c
gcc -c bar.c
ar rc mylibrary.a foo.o bar.o
For more information about this, read the GCC manual manual to learn how to use the compiler, and the linker via the compiler. The binutils manual should also be helpful.
Answer 2: The GNU Make manual is pretty good. To really learn about libraries and how they work, read the Linkers and Loaders book by John R. Levine.
Static libraries are pretty simple, but shared libraries can be very hairy, depending on the platform and the amount of portability you want and need. As an example, on some systems static and shared libraries must be compiled with different options to work properly (one must and the other must not be compiled with position independent code). Whole frameworks of utilities have been developed to make this easier (libtool), but they are not unproblematic themselves.