Create C Program with Dynamic Library using Command Line in Mac OS X
For those who are not familiar with static and dynamic library, the differences between static and dynamic library is the way it was compile and run. To use a static library, the application and the static library must be present during compilation. The compiler will extract the code from the static library and incorporated into the application program. You'll have only one application binary file. When using dynamic library, the compiler do not incorporate the code from the dynamic library into the application program. The application program will load the library during runtime. In this case, you'll need to deliver two binary files to the user; the main application binary and the dynamic library file. The advantages of using dynamic library are smaller application size since the library code is not incorporated in the application program and it may reduce memory usage when since the library is loaded only when the function is needed. There are two usage of dynamic ...