This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Linking options
- From: "Claudio Bley" <bley at cs dot uni-magdeburg dot de>
- To: gcc-help at gcc dot gnu dot org
- Date: Thu, 29 Aug 2002 14:09:52 +0200
- Subject: Re: Linking options
- References: <200208291024.NAA09187@diamond.vtt.fi>
>>>>> "Jouko" == Jouko Marjonen <Jouko.Marjonen@vtt.fi> writes:
Jouko> Dear Sir/Mrs,
Jouko> I have a great need to apply mathematical function in my
Jouko> work. The 'man gcc' advices me to compile my program with
Jouko> -lm option. According to 'man gcc' the '-l<lib>' tells to
Jouko> linkker to include the library <lib> followed by 'l'. If
Jouko> 'm' is the library where does is locate in UNIX?
'man gcc' says, that when using the '-llibrary' switch that `library'
is the library (name) <quote>, which is actually a file named
`liblibrary.a'. </quote>
So, search for a file called libm.a: 'locate libm.a'. libm.a most
likely resides in /usr/lib.
Jouko> A general hint is that the MAN page on a specific function
Jouko> MIGHT tell what are required options to include any library
Jouko> with the calling program. But what to do when no such
Jouko> option information is offered in the manual page?
Usually, you know what library you're using, don't you? It needs to be
documented by the library which functions it provides and how to
compile/link against it, GCC is not (cannot) be responsible for that -
it's just a compiler!
Jouko> I am especially interrested in to call delay()-function
Jouko> which requires <sys/ddi.h> and <sys/types.h> to be
Jouko> included. Therefore, the question is: What the option
Jouko> should I use with gcc to do the job?
Just specify "#include <sys/ddi.h>" in your source file where you want
to use the delay function. I don't know which library implements this
function (is it a system call possibly? In that case you may not need
to link against an auxiliary library).
Jouko> I also like to know, is there any covering source of
Jouko> information that can tell what binary libraries are linked
Jouko> with what functions? The 'man' -pages would be a good place
Jouko> for such an information. So. is it possible to update the
Jouko> manu- al pages with that information.
See above. Most libraries do not belong to gcc and hence there's
nothing it can do about it. You need to consult the documentation of
the respective library.
--
Claudio Bley _
ASCII ribbon campaign ( )
ICQ# 83197241 - against HTML email X
http://www.cs.uni-magdeburg.de/~bley/ & vCards / \