That isn't really a sufficient definition of a library. Yes, a library is a 'collection of code' that has already been made, but it is important to understand that a library is a pre-compiled binary, either a .lib file or a .dll file. They are all basically just .exe files, except .lib files are static which means there is a different copy made for every program that uses it, where all programs that use a .dll share the same .dll file (it's an important difference to understand).