Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

HOW CAN ADD OUR FUNCTION IN LIBRARY.

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


Please Help Members By Posting Answers For Below Questions

Why can arithmetic operations not be performed on void pointers?

1096


what are the different storage classes in c?

1233


What is meant by preprocessor in c?

1072


When should the const modifier be used?

1154


`write a program to display the recomended action depends on a color of trafic light using nested if statments

2179


How can you draw circles in C?

1196


write a program to print largest number of each row of a 2D array

2372


What is a macro?

1163


What is the difference between memcpy and memmove?

1085


What are pointers? What are different types of pointers?

1219


Why doesnt this code work?

1123


What is a structural principle?

1241


What are the application of void data type in c?

1232


Describe the order of precedence with regards to operators in C.

1100


Give the rules for variable declaration?

1218