Skip to content

Instantly share code, notes, and snippets.

@sighingnow
Created November 22, 2016 12:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sighingnow/0421b5cd617a5edde9ee72e0942a2bc4 to your computer and use it in GitHub Desktop.
Save sighingnow/0421b5cd617a5edde9ee72e0942a2bc4 to your computer and use it in GitHub Desktop.
Merge two archive files (.a) into a single one.
## place object files (.o) in two different folders to vaoid overlapping.
mkdir libA
cd libA
ar -x ../libA.a
cd ..
mkdir libB
cd libB
ar -x ../libB.a
cd ..
ar -qc libC.a libA/*.o libB/*.o
## optimize new archive library, optional.
ranlib libC.a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment