After I wrote all the functions, how do I create my own *.lib file?
Printable View
After I wrote all the functions, how do I create my own *.lib file?
This is for gcc
Then later, to use it in another programCode:gcc -c lib1.c lib2.c ...
ar cr libfoo.a lib1.o lib2.o ...
Code:gcc -o prog prog.c -L/path/to/foo -lfoo
is there a way to do this with borland?
Read the manual and find similar looking commands?
Ok, but I don't understand this line: ar cr libfoo.a lib1.o lib2.o
what is the libfoo.a ?
ar - the name of the librarian
cr - specifies that the library is to be created
libfoo.a - the name of the library you want to create. In Unix convention, 'lib' and '.a' are assumed, so the only part you get to choose the name of is 'foo'
lib1.o... - the names of all the object files you want to add to the library
Basically, it says
I want to add all these objects to this library
What is foo you ask
so in the end i'll have only one file called libfoo.a ?
The avalanche has already begun, it is too late for the pebbles to vote
I'll take it as a yes.
Thanks alot.