Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

Command to create a static library in C

ar rc libutil.a util_file.o util_net.o util_math.o
#This command creates a static library named 'libutil.a' and puts
#copies of the object files "util_file.o", "util_net.o" and "util_math.o" in it.
#If the library file already exists, it has the object files added to it, or replaced,
#if they are newer than those inside the library.
#The 'c' flag tells ar to create the library if it doesn't already exist.
#The 'r' flag tells it to replace older object files in the library, with the new object files.
Source by docencia.ac.upc.edu #
 
PREVIOUS NEXT
Tagged: #Command #create #static #library #C
ADD COMMENT
Topic
Name
1+5 =