Summarizing https://www.youtube.com/watch?v=t5TfYRRHG04&t=84s
- Create a source file (.c) and header file (.h)
- Write function in source file and prototype in header file
- Create
libandincludedirectory gcc -c <source>.c-
ar cr lib<name>.a <source>.o. Defines library name output and source object file -
ar t lib<name>.ato find out what function names are included - move the
lib<name>.afile tolibfolder -
gcc <source>.c -l<name> -L <library_folder_name> -o <output_file_name> -I <include_folder_name>. If you createdlibandincludedirectory that's where they should go under librar_folder_name and include_folder_name.
Top comments (0)