A friend of my asked me how shared libraries are created and used in Linux environment. I really didn’t know this as I have never written C programs, I had to do some googling. I’m writing this page as a reminder for myself and anyone who wants (possibly) bad advises.
1. Compile your library code as objects:
gcc -c libraryfile1.c -fPIC
gcc -c libraryfile2.c -fPIC
2. Link objects into a shared library
gcc -shared -o libmylib.so libraryfile1.o libraryfile2.o
3. Compile actual programs as follows
gcc -o actualprogram -L. -lmylib actualprogram.c
where gcc outputs compilation of actualprogram.c into file actualprogram and links libmylib.so in current directory into it.
(Those who don’t believe these instructions can read them in their original location at vergil.chemisty.gatech.edu)
Apparently shared libraries/dynamic linking libraries work completely different in MS “Hole in wall” environment.