next up previous contents
Next: Example: Creating Zoo Library Up: Libraries Previous: Creating Static Libraries   Contents

Creating Dynamic/Shareable Libraries

Creating dynamic libraries is rather like linking an executable, as the linker has to extract link information to allow the code to be loaded in during program execution. To create the library libMyLib.so from files a.o, b.o, c.o:-

g++ -shared -o libMyLib.so a.o b.o c.o

The -o identifies the following name as the output file.



P.D. Gronbech (IT Staff) 2015-10-02