Solved

Unix Make ar and ld

Posted on 2003-12-11
4
457 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 9

Accepted Solution

by:
HamdyHassan earned 25 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 25 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

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…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

630 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