C Board  

Go Back   C Board > General Programming Boards > C Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 07-18-2003, 07:25 PM   #1
Registered User
 
Join Date: Jul 2002
Posts: 913
howto make a static library?

how do you create a static library, like the standard ones?

if i have test.c i start with :
  • gcc -c test.c
    ar -cr test.a test.o
    ranlib test.a
where do i go from there?

i cant find a stdio.a anywhere, how are the standard ones made?
mart_man00 is offline   Reply With Quote
Old 07-19-2003, 04:31 PM   #2
Registered User
 
Join Date: Jul 2002
Posts: 913
can i combine libraries together?

right now if i have test1.c and test2.c i run
Code:
gcc -c test1.c
ar -cr libtest1.a test1.o
ranlib libtest1.a

gcc -c test2.c
ar -cr libtest2.a test2.o
ranlib libtest2.a

ld -r -o test.o test1.o test2.o
ar -cr libtest.a test.o
ranlib libtest.a
can i cut out the object files and go right to combining and indexing? how?
mart_man00 is offline   Reply With Quote
Old 07-19-2003, 11:10 PM   #3
Comment your source code!
 
Lynux-Penguin's Avatar
 
Join Date: Apr 2002
Posts: 533
I don't know enough about this to actually help you but its in this book somewhere, I remember skimming over it and noticing a good portion on it.

Advanced Linux Programming

Sorry if I can't be of more help.

And I would like to thank Salem for showing me the link, it has proven useful time and time again.

-LC
__________________
Asking the right question is sometimes more important than knowing the answer.
Please read the FAQ
C Reference Card (A MUST!)
Pointers and Memory
The Essentials
CString lib
Lynux-Penguin is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help building/linking to static library Kernel Sanders C++ Programming 19 08-17-2008 04:35 PM
Howto make own application for remote control handling s-men Windows Programming 16 08-16-2008 04:22 PM
difference between dynamic link library and static library studentc C Programming 19 01-12-2006 11:04 AM
Using private class members in static functions sethjackson C++ Programming 2 09-23-2005 09:54 AM
opengl program as win API menu item SAMSAM Game Programming 1 03-03-2003 07:48 PM


All times are GMT -6. The time now is 10:15 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22