Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Unix Make ar and ld

Posted on 2003-12-11
4
Medium Priority
?
464 Views
Last Modified: 2013-12-26
What do ar and ld exactly do in making a library? Are these diiferent programs for the same purpose or are they used in tandem for file archiving. Can anybody point me to some links. I heard that the order of the libraries matters in ar and does not in ld. can somebody elaborate.

Thanks,
--P
0
Comment
Question by:supavan
4 Comments
 
LVL 9

Accepted Solution

by:
HamdyHassan earned 100 total points
ID: 9923940

do the following
$ man ar
$ man ld

check "Creating Unix Libraries" at
http://www.cs.duke.edu/~ola/courses/programming/libraries.html

From this article, you could see "ar" is used for "Static Libraries" and "ld" is used for "Dynamic libraries"


0
 
LVL 51

Assisted Solution

by:ahoffmann
ahoffmann earned 100 total points
ID: 9930977
.. completing HamdyHassan comment:
ar - maintain portable archive or library
simply maintains a group of (.o) files in an archive.
When building executable from object files or archives, the order is important.

ld - link-editor for object files
is either used to build (dynamic) hared objects, which either is a (dynamic) shared library, or an executable.
For these objects the oder is not important as long as there are no cyclic references and no other static objects.
For details see corresponding man pages
0
 
LVL 18

Expert Comment

by:liddler
ID: 10241422
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Points split HamdyHassan & ahoffmann

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

liddler
EE Cleanup Volunteer
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Loops Section Overview

926 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question