Answer Posted / ataraxic
Using ar utility.
Let's say we have lib1.c lib2.c and myprog.c
We want to do a library from lib1.c && lib2.c, and compile
myprog.c with this library afterwards.
The steps are:
Compile
1. gcc -c lib1.c -o lib1.o
2. gcc -c lib2.c -o lib2.o
Create archive named libmy.a
3. ar -rcsv libmy.a lib1.o lib2.o
Compile myprog with newly created lib
4. gcc myprog.c -L. -lmy -o myprog
| Is This Answer Correct ? | 3 Yes | 4 No |
Post New Answer View All Answers
What is indirection? How many levels of pointers can you have?
The statement, int(*x[]) () what does in indicate?
How can I change their mode to binary?
What is scope rule in c?
Tell me is null always defined as 0(zero)?
What is bash c?
How can I sort more data than will fit in memory?
FILE PROGRAMMING
What is auto keyword in c?
What is extern c used for?
Explain what are reserved words?
What is #include stdlib h?
What is structure of c program?
What is indirection?
how to count no of words,characters,lines in a paragraph.