<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <!--Converted with LaTeX2HTML 2008 (1.71) original version by: Nikos Drakos, CBLU, University of Leeds * revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan * with significant contributions from: Jens Lippmann, Marek Rouchal, Martin Wilck and others --> <HTML> <HEAD> <TITLE>3.1.6 Using ar to Create and Manage Libraries</TITLE> <META NAME="description" CONTENT="3.1.6 Using ar to Create and Manage Libraries"> <META NAME="keywords" CONTENT="sdccman"> <META NAME="resource-type" CONTENT="document"> <META NAME="distribution" CONTENT="global"> <META NAME="Generator" CONTENT="LaTeX2HTML v2008"> <META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"> <LINK REL="STYLESHEET" HREF="sdccman.css"> <LINK REL="previous" HREF="node43.html"> <LINK REL="up" HREF="node38.html"> <LINK REL="next" HREF="node45.html"> </HEAD> <BODY > <!--Navigation Panel--> <A NAME="tex2html1323" HREF="node45.html"> <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> <A NAME="tex2html1317" HREF="node38.html"> <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> <A NAME="tex2html1313" HREF="node43.html"> <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> <A NAME="tex2html1319" HREF="node1.html"> <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> <A NAME="tex2html1321" HREF="node191.html"> <IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> <BR> <B> Next:</B> <A NAME="tex2html1324" HREF="node45.html">3.2 Command Line Options</A> <B> Up:</B> <A NAME="tex2html1318" HREF="node38.html">3.1 Compiling</A> <B> Previous:</B> <A NAME="tex2html1314" HREF="node43.html">3.1.5 Using sdcclib to</A> <B> <A NAME="tex2html1320" HREF="node1.html">Contents</A></B> <B> <A NAME="tex2html1322" HREF="node191.html">Index</A></B> <BR> <BR> <!--End of Navigation Panel--> <H2><A NAME="SECTION00416000000000000000"></A><A NAME="826"></A><A NAME="sub:Using-ar-to"></A> <BR> 3.1.6 Using ar to Create and Manage Libraries </H2> <P> Support for ar format libraries was introduced in sdcc 2.9.0. Ar is a standard archive managing utility on unices (Linux, Mac OS X, several unix flavors) so it is not included in the sdcc package. <BR> <BR> For Windows platform you can find ar utility in GNU binutils package included in several projects: Cygwin at <TT><A NAME="tex2html24" HREF="http://www.cygwin.com/">http://www.cygwin.com/</A></TT>, MinGW at <TT><A NAME="tex2html25" HREF="http://www.mingw.org/">http://www.mingw.org/</A></TT>. <BR> <BR> Both the GNU and BSD ar format variants are supported by sdld linkers. Ar doesn't natively understand the sdas object file format, so there is a special version of ranlib distributed with sdcc, called asranlib, which produces the ar symbol lookup table. <BR> <BR> To create a library containing sdas object files, you should use the following sequence: <BR> <P> <I><B>ar -Sq <library name>.lib <list of .rel files></B></I> <P> <I><B>asranlib <library name>.lib</B></I> <P> <P><P> <BR> <P> <BR><HR> <ADDRESS> 2011-03-20 </ADDRESS> </BODY> </HTML>