CIS 29 - Notes for Tuesday, 1/22

Announcements and Reminders

Libraries

Why use libraries?

  • To avoid reinventing the wheel
  • To facilitate organization of your code
  • To be able to independently code and test functions, classes, modules
  • To share code

Types of libraries

TypeHow It worksFile extensionsPlatform
staticCode is fetch from the library archive and inserted into the executable.a
.lib (MSVS)
all
dynamicThe library is loaded into memory or cache memory and code is retrieved as needed.dllpc & mac
sharedThe library, or parts of it, is loaded into memory or cache memory and code is retrieved as needed.  The library may be shared among multiple users.so or .so#Linux

How to

Organize File Directory Structure

Demonstration

Directory File Structure

Source files

  • Code::Blocks

  • MS Visual Studio

  • Linux