public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Linking options
@ 2002-08-29  3:24 Jouko Marjonen
  2002-08-29  5:09 ` Claudio Bley
  0 siblings, 1 reply; 2+ messages in thread
From: Jouko Marjonen @ 2002-08-29  3:24 UTC (permalink / raw)
  To: gcc-help


Dear Sir/Mrs,

I have a great need to apply mathematical function in my work. The 'man gcc'
advices me to compile my program with -lm option.
According to 'man gcc' the '-l<lib>' tells to linkker to include the library
<lib> followed by 'l'. If 'm' is the library where does is locate in UNIX?

A general hint is that the MAN page on a specific function MIGHT tell
what are required options to include any library with the calling program.
But what to do when no such option information is offered in the manual 
page?

I am especially interrested in to call delay()-function which requires
<sys/ddi.h> and  <sys/types.h> to be included. Therefore, the question is:
What the option should I use with gcc to do the job?

I also like to know, is there any covering source of information that can tell
what binary libraries are linked with what functions? The 'man' -pages would
be a good place for such an information. So. is it possible to update the manu-
al pages with that information.

If you have time, willigness and interrest to help me with this puzzle, I
would appreciate your efforts very much.

With Best regards, 




******************** Jouko Marjonen  *****************************************
**********  VTT Electronics / Microelectronics   *****************************
*********  P.O.Box 1101, FIN-02044 VTT, Finland   ****************************
********  Tel. +358 9 456 6626, Fax +358 9 456 7012  *************************
*************  e-mail: jouko.marjonen@vtt.fi   *****************************




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Linking options
  2002-08-29  3:24 Linking options Jouko Marjonen
@ 2002-08-29  5:09 ` Claudio Bley
  0 siblings, 0 replies; 2+ messages in thread
From: Claudio Bley @ 2002-08-29  5:09 UTC (permalink / raw)
  To: gcc-help

>>>>> "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 / \

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-08-29 12:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-29  3:24 Linking options Jouko Marjonen
2002-08-29  5:09 ` Claudio Bley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).