Results 1 to 3 of 3
To create a static library, or to add additional object files to an existing static library, I can use a command like this:
ar rcs my_library.a file1.o file2.o
But how ...
- 03-31-2010 #1Just Joined!
- Join Date
- Mar 2010
- Posts
- 3
How to add a static library to my own static library
To create a static library, or to add additional object files to an existing static library, I can use a command like this:
ar rcs my_library.a file1.o file2.o
But how to add an existing static library to my own static library.
I have created my own static library using the command above and want to link against the library libuuid.a (placed in /usr/lib/).
Can I use ar to add libuuid.a to my_library.a?
- 03-31-2010 #2
Why not just link against both static libraries? What purpose do you have for including one in another?
- 03-31-2010 #3Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
I usually extract the object files out of the library in question and add them to my library when I need to deliver a single library to users instead of a bunch. This isn't always the best approach, but it does sometimes solve otherwise knotty problems.
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!


Reply With Quote