Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c > #16269 > unrolled thread
| Started by | Avinash Sonawane <avinash.sonawane1990@gmail.com> |
|---|---|
| First post | 2012-01-26 13:59 -0800 |
| Last post | 2012-01-27 11:12 -0600 |
| Articles | 20 on this page of 100 — 30 participants |
Back to article view | Back to comp.lang.c
About -lm switch used for linking math.h Avinash Sonawane <avinash.sonawane1990@gmail.com> - 2012-01-26 13:59 -0800
Re: About -lm switch used for linking math.h Keith Thompson <kst-u@mib.org> - 2012-01-26 14:15 -0800
Re: About -lm switch used for linking math.h James Kuyper <jameskuyper@verizon.net> - 2012-01-26 17:17 -0500
Re: About -lm switch used for linking math.h Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-01-26 20:54 -0500
Re: About -lm switch used for linking math.h Kaz Kylheku <kaz@kylheku.com> - 2012-01-27 02:12 +0000
Re: About -lm switch used for linking math.h jacob navia <jacob@spamsink.net> - 2012-01-26 23:29 +0100
Re: About -lm switch used for linking math.h Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2012-01-26 23:09 -0700
Re: About -lm switch used for linking math.h jacob navia <jacob@spamsink.net> - 2012-01-27 08:37 +0100
Re: About -lm switch used for linking math.h gazelle@shell.xmission.com (Kenny McCormack) - 2012-01-27 09:48 +0000
OT:Re: About -lm switch used for linking math.h Kleuske <kleuske@nowhere.net> - 2012-01-27 10:15 +0000
Re: OT:Re: About -lm switch used for linking math.h gazelle@shell.xmission.com (Kenny McCormack) - 2012-01-27 14:43 +0000
Re: OT:Re: About -lm switch used for linking math.h tom st denis <tom@iahu.ca> - 2012-01-27 07:49 -0800
Re: OT:Re: About -lm switch used for linking math.h gazelle@shell.xmission.com (Kenny McCormack) - 2012-01-27 15:55 +0000
Re: OT:Re: About -lm switch used for linking math.h tom st denis <tom@iahu.ca> - 2012-01-27 10:14 -0800
Re: OT:Re: About -lm switch used for linking math.h Keith Thompson <kst-u@mib.org> - 2012-01-27 11:23 -0800
Re: OT:Re: About -lm switch used for linking math.h Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2012-01-27 09:42 -0700
Re: OT:Re: About -lm switch used for linking math.h 88888 Dihedral <dihedral88888@googlemail.com> - 2012-01-28 14:08 -0800
Re: OT:Re: About -lm switch used for linking math.h Phil Carmody <thefatphil_demunged@yahoo.co.uk> - 2012-02-14 13:14 +0200
Re: About -lm switch used for linking math.h Rui Maciel <rui.maciel@gmail.com> - 2012-01-27 16:56 +0000
Re: About -lm switch used for linking math.h gazelle@shell.xmission.com (Kenny McCormack) - 2012-01-27 17:34 +0000
Re: About -lm switch used for linking math.h Rui Maciel <rui.maciel@gmail.com> - 2012-01-27 17:50 +0000
Re: About -lm switch used for linking math.h Kaz Kylheku <kaz@kylheku.com> - 2012-01-27 17:58 +0000
Re: About -lm switch used for linking math.h tom st denis <tom@iahu.ca> - 2012-01-27 10:15 -0800
Re: About -lm switch used for linking math.h gazelle@shell.xmission.com (Kenny McCormack) - 2012-01-27 19:25 +0000
Re: About -lm switch used for linking math.h Kleuske <kleuske@nowhere.net> - 2012-01-28 18:09 +0000
Re: About -lm switch used for linking math.h jt@toerring.de (Jens Thoms Toerring) - 2012-01-27 21:32 +0000
Re: About -lm switch used for linking math.h "Wolfgang.Draxinger" <Wolfgang.Draxinger@physik.uni-muenchen.de> - 2012-01-27 12:40 +0100
Re: About -lm switch used for linking math.h "BartC" <bc@freeuk.com> - 2012-01-27 12:48 +0000
Re: About -lm switch used for linking math.h Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-01-27 14:28 +0000
Re: About -lm switch used for linking math.h Kaz Kylheku <kaz@kylheku.com> - 2012-01-27 17:14 +0000
Re: About -lm switch used for linking math.h gazelle@shell.xmission.com (Kenny McCormack) - 2012-01-27 17:34 +0000
Re: About -lm switch used for linking math.h Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2012-01-27 10:43 -0700
Re: About -lm switch used for linking math.h Stephen Sprunk <stephen@sprunk.org> - 2012-01-27 12:25 -0600
Re: About -lm switch used for linking math.h "BartC" <bc@freeuk.com> - 2012-01-27 18:41 +0000
Re: About -lm switch used for linking math.h James Kuyper <jameskuyper@verizon.net> - 2012-01-27 13:45 -0500
Re: About -lm switch used for linking math.h Keith Thompson <kst-u@mib.org> - 2012-01-27 11:29 -0800
Re: About -lm switch used for linking math.h Jens Gustedt <jens.gustedt@loria.fr> - 2012-01-27 22:35 +0100
Re: About -lm switch used for linking math.h Stephen Sprunk <stephen@sprunk.org> - 2012-01-27 17:19 -0600
Re: About -lm switch used for linking math.h James Kuyper <jameskuyper@verizon.net> - 2012-01-27 19:22 -0500
Re: About -lm switch used for linking math.h Tim Rentsch <txr@alumni.caltech.edu> - 2012-01-31 23:32 -0800
Re: About -lm switch used for linking math.h Keith Thompson <kst-u@mib.org> - 2012-01-27 16:26 -0800
Re: About -lm switch used for linking math.h Ian Collins <ian-news@hotmail.com> - 2012-01-28 13:30 +1300
Re: About -lm switch used for linking math.h Keith Thompson <kst-u@mib.org> - 2012-01-27 17:04 -0800
Re: About -lm switch used for linking math.h Ian Collins <ian-news@hotmail.com> - 2012-01-28 14:10 +1300
Re: About -lm switch used for linking math.h Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-01-27 21:06 -0500
Re: About -lm switch used for linking math.h Keith Thompson <kst-u@mib.org> - 2012-01-27 20:09 -0800
Re: About -lm switch used for linking math.h Keith Thompson <kst-u@mib.org> - 2012-01-27 20:15 -0800
Re: About -lm switch used for linking math.h Stephen Sprunk <stephen@sprunk.org> - 2012-01-27 23:03 -0600
Re: About -lm switch used for linking math.h Ian Collins <ian-news@hotmail.com> - 2012-01-28 19:10 +1300
Re: About -lm switch used for linking math.h Malcolm McLean <malcolm.mclean5@btinternet.com> - 2012-01-28 04:28 -0800
Re: About -lm switch used for linking math.h Stephen Sprunk <stephen@sprunk.org> - 2012-01-28 15:25 -0600
Re: About -lm switch used for linking math.h Ian Collins <ian-news@hotmail.com> - 2012-01-29 11:39 +1300
Re: About -lm switch used for linking math.h Nick Keighley <nick_keighley_nospam@hotmail.com> - 2012-01-29 09:53 -0800
Re: About -lm switch used for linking math.h Jorgen Grahn <grahn+nntp@snipabacken.se> - 2012-02-03 10:39 +0000
Re: About -lm switch used for linking math.h Joshua Maurice <joshuamaurice@gmail.com> - 2012-02-01 16:42 -0800
Re: About -lm switch used for linking math.h jgk@panix.com (Joe keane) - 2012-02-02 01:29 +0000
Re: About -lm switch used for linking math.h Keith Thompson <kst-u@mib.org> - 2012-01-28 15:22 -0800
Re: About -lm switch used for linking math.h Stephen Sprunk <stephen@sprunk.org> - 2012-01-29 16:52 -0600
Re: About -lm switch used for linking math.h Keith Thompson <kst-u@mib.org> - 2012-01-30 02:04 -0800
Re: About -lm switch used for linking math.h Ike Naar <ike@iceland.freeshell.org> - 2012-01-30 10:22 +0000
Re: About -lm switch used for linking math.h Keith Thompson <kst-u@mib.org> - 2012-01-30 02:36 -0800
Re: About -lm switch used for linking math.h Phil Carmody <thefatphil_demunged@yahoo.co.uk> - 2012-02-14 13:33 +0200
Re: About -lm switch used for linking math.h Ike Naar <ike@iceland.freeshell.org> - 2012-02-14 23:48 +0000
Re: About -lm switch used for linking math.h Keith Thompson <kst-u@mib.org> - 2012-02-14 16:35 -0800
Re: About -lm switch used for linking math.h Phil Carmody <thefatphil_demunged@yahoo.co.uk> - 2012-02-22 02:44 +0200
Re: About -lm switch used for linking math.h Malcolm McLean <malcolm.mclean5@btinternet.com> - 2012-01-30 04:30 -0800
Re: About -lm switch used for linking math.h Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-01-30 14:36 +0000
Re: About -lm switch used for linking math.h Tim Rentsch <txr@alumni.caltech.edu> - 2012-01-31 23:50 -0800
Re: About -lm switch used for linking math.h Keith Thompson <kst-u@mib.org> - 2012-01-28 15:29 -0800
Re: About -lm switch used for linking math.h Malcolm McLean <malcolm.mclean5@btinternet.com> - 2012-01-29 09:11 -0800
Re: About -lm switch used for linking math.h "BartC" <bc@freeuk.com> - 2012-01-29 17:49 +0000
Re: About -lm switch used for linking math.h Malcolm McLean <malcolm.mclean5@btinternet.com> - 2012-01-29 10:07 -0800
Re: About -lm switch used for linking math.h Keith Thompson <kst-u@mib.org> - 2012-01-29 14:24 -0800
Re: About -lm switch used for linking math.h Nick Keighley <nick_keighley_nospam@hotmail.com> - 2012-01-29 09:43 -0800
Re: About -lm switch used for linking math.h Keith Thompson <kst-u@mib.org> - 2012-01-27 16:54 -0800
Re: About -lm switch used for linking math.h Kaz Kylheku <kaz@kylheku.com> - 2012-01-28 01:09 +0000
Re: About -lm switch used for linking math.h Ian Collins <ian-news@hotmail.com> - 2012-01-28 14:20 +1300
Re: About -lm switch used for linking math.h Azazel <azazel@remove.azazel.net> - 2012-01-30 17:40 -0600
Re: About -lm switch used for linking math.h Kaz Kylheku <kaz@kylheku.com> - 2012-01-31 00:05 +0000
Re: About -lm switch used for linking math.h jgk@panix.com (Joe keane) - 2012-01-27 20:03 +0000
Re: About -lm switch used for linking math.h Malcolm McLean <malcolm.mclean5@btinternet.com> - 2012-01-27 12:26 -0800
Re: About -lm switch used for linking math.h Ian Collins <ian-news@hotmail.com> - 2012-01-28 10:24 +1300
Re: About -lm switch used for linking math.h "BartC" <bc@freeuk.com> - 2012-01-27 21:32 +0000
Re: About -lm switch used for linking math.h James Kuyper <jameskuyper@verizon.net> - 2012-01-27 16:39 -0500
Re: About -lm switch used for linking math.h Robert Wessel <robertwessel2@yahoo.com> - 2012-01-27 23:24 -0600
Re: About -lm switch used for linking math.h Ian Collins <ian-news@hotmail.com> - 2012-01-28 20:38 +1300
Re: About -lm switch used for linking math.h Robert Wessel <robertwessel2@yahoo.com> - 2012-01-28 02:17 -0600
Re: About -lm switch used for linking math.h Richard Damon <news.x.richarddamon@xoxy.net> - 2012-01-28 14:07 -0500
Re: About -lm switch used for linking math.h Robert Wessel <robertwessel2@yahoo.com> - 2012-01-28 15:07 -0600
Re: About -lm switch used for linking math.h jgk@panix.com (Joe keane) - 2012-01-28 21:09 +0000
Re: About -lm switch used for linking math.h Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2012-01-27 21:39 -0700
Re: About -lm switch used for linking math.h Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-01-28 11:21 +0000
Re: About -lm switch used for linking math.h Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2012-01-28 17:51 -0700
Re: About -lm switch used for linking math.h Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-01-29 02:03 +0000
Re: About -lm switch used for linking math.h Kaz Kylheku <kaz@kylheku.com> - 2012-01-28 18:58 +0000
Re: About -lm switch used for linking math.h jacob navia <jacob@spamsink.net> - 2012-01-28 20:48 +0100
Re: About -lm switch used for linking math.h Robert Wessel <robertwessel2@yahoo.com> - 2012-01-28 22:54 -0600
Re: About -lm switch used for linking math.h jgk@panix.com (Joe keane) - 2012-01-29 21:42 +0000
Re: About -lm switch used for linking math.h Robert Wessel <robertwessel2@yahoo.com> - 2012-01-30 00:14 -0600
Re: About -lm switch used for linking math.h Stephen Sprunk <stephen@sprunk.org> - 2012-01-27 11:12 -0600
Page 1 of 5 [1] 2 3 4 5 Next page →
| From | Avinash Sonawane <avinash.sonawane1990@gmail.com> |
|---|---|
| Date | 2012-01-26 13:59 -0800 |
| Subject | About -lm switch used for linking math.h |
| Message-ID | <33220336.277.1327615195035.JavaMail.geo-discussion-forums@prnc5> |
Sir, I am using gcc 4.6.1. I have few questions regarding -lm switch. Please kindly guide me for the same. 1) Why I need to use -lm flag for math.h even if I had declared the #include <math.h> in the code? 2) If it's all about linking the library then why I don't have to do the same thing with stdio.h too? 3) Or we have to add the -l'library' switch for every library excluding stdio.h? 4) In case if the -l'library' switch is used for some specific libraries only then please direct me to the complete list of such libraries. Thanks.
[toc] | [next] | [standalone]
| From | Keith Thompson <kst-u@mib.org> |
|---|---|
| Date | 2012-01-26 14:15 -0800 |
| Message-ID | <lnpqe62jqg.fsf@nuthaus.mib.org> |
| In reply to | #16269 |
Avinash Sonawane <avinash.sonawane1990@gmail.com> writes:
> I am using gcc 4.6.1.
> I have few questions regarding -lm switch. Please kindly guide me for the same.
>
> 1) Why I need to use -lm flag for math.h even if I had declared the
> #include <math.h> in the code?
"include <math.h>" tells the compiler to, in effect, include the
contents of "math.h" (declarations) in your source file. "-lm" tells
the linker to use the math library, which contains the *implementations*
of the functions declared in math.h.
> the same thing with stdio.h too?
No, because the functions declared in stdio.h are defined in a library
that's linked by default.
> 3) Or we have to add the -l'library' switch for every library excluding stdio.h?
You need "-l" for *some* libraries. For gcc, most of the functions
defined in standard header are in the standard library, which is linked
by default (<math.h> and "-lm" are probably the one exception).
Headers that aren't defined by the C standard may or may not require an
explicit "-l" option.
> 4) In case if the -l'library' switch is used for some specific
> libraries only then please direct me to the complete list of such
> libraries.
There is no such complete list. The libraries that are installed will
vary tremendously from one system to another. You'll just have to read
the documentation for whatever function you want to use. For example,
if you're on a Unix-like system, "man sqrt" will show you the
declaration of the sqrt() function and tell you that you need
"#include <math.h>" and "-lm".
The need to use "-lm" is widely criticized, and there are
implementations that don't require it (that put the math library into
the standard library).
--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
Will write code for food.
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
[toc] | [prev] | [next] | [standalone]
| From | James Kuyper <jameskuyper@verizon.net> |
|---|---|
| Date | 2012-01-26 17:17 -0500 |
| Message-ID | <jfsjdl$1s8$1@dont-email.me> |
| In reply to | #16269 |
On 01/26/2012 04:59 PM, Avinash Sonawane wrote: > Sir, > I am using gcc 4.6.1. > I have few questions regarding -lm switch. Please kindly guide me for the same. > > 1) Why I need to use -lm flag for math.h even if I had declared the > #include <math.h> in the code? #include <math.h> tells the compiler which library header to insert into your program when compiling. -lm tells the linker which library to search when linking your compiled program. A compiler could connect the two, but most of the ones I'm familiar with don't. > 2) If it's all about linking the library then why I don't have to do > the same thing with stdio.h too? By convention dating back to the early days of C, most of the C standard library is often stored in one library file, except for the part described by <math.h>, which is stored in a different one. This approach became conventional because, especially at that time, most programs made no use of the math library, and adding all of those functions to the linker's search would significantly slowed down linkage. This is far less of an issue now than it used to be, but some habits, once started, are hard to change. > 3) Or we have to add the -l'library' switch for every library excluding stdio.h? No. > 4) In case if the -l'library' switch is used for some specific > libraries only then please direct me to the complete list of such > libraries. Any such list could, in principle, be different for different compilers, and there's no way it could be complete - there's millions of libraries out there. The best you can hope for is a list of C standard library parts. However, for most systems I've familiar with, <math.h> is the only part of the C standard library that has it's own separate library file.
[toc] | [prev] | [next] | [standalone]
| From | Eric Sosman <esosman@ieee-dot-org.invalid> |
|---|---|
| Date | 2012-01-26 20:54 -0500 |
| Message-ID | <jft055$8gi$1@dont-email.me> |
| In reply to | #16272 |
On 1/26/2012 5:17 PM, James Kuyper wrote:
> On 01/26/2012 04:59 PM, Avinash Sonawane wrote:
>> Sir,
>> I am using gcc 4.6.1.
>> I have few questions regarding -lm switch. Please kindly guide me for the same.
>>
>> 1) Why I need to use -lm flag for math.h even if I had declared the
>> #include<math.h> in the code?
>
> #include<math.h> tells the compiler which library header to insert into
> your program when compiling. -lm tells the linker which library to
> search when linking your compiled program. A compiler could connect the
> two, but most of the ones I'm familiar with don't.
>
>> 2) If it's all about linking the library then why I don't have to do
>> the same thing with stdio.h too?
>
> By convention dating back to the early days of C, most of the C standard
> library is often stored in one library file, except for the part
> described by<math.h>, which is stored in a different one. This approach
> became conventional because, especially at that time, most programs made
> no use of the math library, and adding all of those functions to the
> linker's search would significantly slowed down linkage. This is far
> less of an issue now than it used to be, but some habits, once started,
> are hard to change.
In at least one C implementation, the math functions have in
fact been combined with the rest of the library and all are linked
automatically with no need for -lm. This implementation also provides
a completely empty "libm" library, just to accommodate Makefiles and
so on that use -lm anyhow!
--
Eric Sosman
esosman@ieee-dot-org.invalid
[toc] | [prev] | [next] | [standalone]
| From | Kaz Kylheku <kaz@kylheku.com> |
|---|---|
| Date | 2012-01-27 02:12 +0000 |
| Message-ID | <20120126180345.233@kylheku.com> |
| In reply to | #16272 |
On 2012-01-26, James Kuyper <jameskuyper@verizon.net> wrote: > By convention dating back to the early days of C, most of the C standard > library is often stored in one library file, except for the part > described by <math.h>, which is stored in a different one. This approach > became conventional because, especially at that time, most programs made > no use of the math library, and adding all of those functions to the > linker's search would significantly slowed down linkage. This is far > less of an issue now than it used to be, but some habits, once started, > are hard to change. I suspect there is one more reason and it is related to the reason why there are separate /bin and /usr/bin directories as well as /lib and /usr/lib. Disks used to be small, and so programs had to be separated into essential (for booting the system) and nonessential. If programs linked the math library by default, then the math library would have to have been placed in the root file system (so that the utilities which run early in the boot process could execute). (The issue of what executable material to include in a minimal filesystem for booting is still relevant.)
[toc] | [prev] | [next] | [standalone]
| From | jacob navia <jacob@spamsink.net> |
|---|---|
| Date | 2012-01-26 23:29 +0100 |
| Message-ID | <jfsk3m$v2n$1@speranza.aioe.org> |
| In reply to | #16269 |
Le 26/01/12 22:59, Avinash Sonawane a écrit : > Sir, > I am using gcc 4.6.1. > I have few questions regarding -lm switch. Please kindly guide me for the same. > > 1) Why I need to use -lm flag for math.h even if I had declared the > #include<math.h> in the code? Because you do not have a Macintosh. If you would have one, you wouldn't need that. > 2) If it's all about linking the library then why I don't have to do > the same thing with stdio.h too? Because of hysterical reasons. > 3) Or we have to add the -l'library' switch for every library excluding stdio.h? Yes. For each library you should add the corresponding name to the link command. > 4) In case if the -l'library' switch is used for some specific > libraries only then please direct me to the complete list of such > libraries. > The -l'library' switch is needed for all the libraries not included by default. Most linkers include some libraries by default, at least the C library (that is why you do not need to include the stdio library). In more advanced systems, there is no distinction between the stdio library and the mathematical library: they are all part of the C library and included by default. Those systems do NOT need any -lm switch. There are other systems that provide many more libraries included by default. There are some linkers/IDE combinations that have a small database of which functions are included in which library so that it isn't needed to remember the name of the library, the IDE just consults its database and figures out the correct switch for the linker.
[toc] | [prev] | [next] | [standalone]
| From | Joe Pfeiffer <pfeiffer@cs.nmsu.edu> |
|---|---|
| Date | 2012-01-26 23:09 -0700 |
| Message-ID | <1bipjxvfqk.fsf@pfeifferfamily.net> |
| In reply to | #16269 |
Avinash Sonawane <avinash.sonawane1990@gmail.com> writes:
> Sir,
> I am using gcc 4.6.1.
> I have few questions regarding -lm switch. Please kindly guide me for the same.
>
> 1) Why I need to use -lm flag for math.h even if I had declared the
> #include <math.h> in the code?
There are two distinct phases here: #include <math.h> tells the
compiler what the match functions look like, -lm actually links in the
code for them.
> 2) If it's all about linking the library then why I don't have to do
> the same thing with stdio.h too?
Because that's *so* standard it's just assumed. More specifically,
there is a "standard C library" which is automatically linked with your
code, and all of the functions from <stdio.h> are in that library.
The better question would be why the C standard library function
prototypes aren't all automatically available, without a bunch of
#include's. To me it seems like they ought to be, but the people
writing the standards and the people writing the compilers don't agree
with me, so they aren't.
> 3) Or we have to add the -l'library' switch for every library
> excluding stdio.h?
You've got a little bit of confusion going on here, which I've alluded
to above but I'll say more specifically here: a .h file is not a
library. A .h file contains function prototypes, which tell the
compiler how to generate code to make calls to the functions. That has
nothing at all to do with the code that's in the actual library --
that's what the -l flag pulls in.
OK, when I say it has "nothing to do with" that's overstating things a
bit: assuming no bugs, the .h file is designed to make sure calls to
the library are actually correct. But aside from that intention, they
are unrelated.
> 4) In case if the -l'library' switch is used for some specific
> libraries only then please direct me to the complete list of such
> libraries.
There is no complete list. Any particular system will have its own set
of libraries, depending on what's been installed on it. If you want,
you can create a library of your own that exists only on your own
system, and which won't be in any list.
If you're on a Unix-based system (including Linux and BSD), the man
page for a function will tell you both what .h file you need to #include
to compile it, and what library you need to use to link it. So, for
instance, the man page for the sin function says:
#include <math.h>
double sin(double x);
float sinf(float x);
long double sinl(long double x);
Link with -lm.
So, to be able to use sin(), sinf(), or sinl(), you need to
#include <math.h> and link with -lm
[toc] | [prev] | [next] | [standalone]
| From | jacob navia <jacob@spamsink.net> |
|---|---|
| Date | 2012-01-27 08:37 +0100 |
| Message-ID | <jftk7c$ppa$1@speranza.aioe.org> |
| In reply to | #16279 |
Le 27/01/12 07:09, Joe Pfeiffer a écrit : > > The better question would be why the C standard library function > prototypes aren't all automatically available, without a bunch of > #include's. To me it seems like they ought to be, but the people > writing the standards and the people writing the compilers don't agree > with me, so they aren't. > The lcc-win compiler provides the "stdheaders.h" include file that includes all the standard headers sparing you the need to figure out what function is in what header. I proposed that in comp.std.c years ago, but it was ignored in the new standard.
[toc] | [prev] | [next] | [standalone]
| From | gazelle@shell.xmission.com (Kenny McCormack) |
|---|---|
| Date | 2012-01-27 09:48 +0000 |
| Message-ID | <jftrt6$pen$1@news.xmission.com> |
| In reply to | #16279 |
In article <1bipjxvfqk.fsf@pfeifferfamily.net>,
Joe Pfeiffer <pfeiffer@cs.nmsu.edu> wrote:
...
>If you're on a Unix-based system (including Linux and BSD), the man
>page for a function will tell you both what .h file you need to #include
>to compile it, and what library you need to use to link it. So, for
>instance, the man page for the sin function says:
This isn't necessarily true (and, in true CLC fashion, I'm going to go to
great pains to explain why your statement isn't true in absolute
generality). All versions of MS/PC DOS/Windows, since DOS 2.0, are
Unix-based, yet, when I type "man {anything}" on my Windows Server 2008 R2
Home Premium Super Deluxe (*), all I get is some dumb error message.
(*) With wheels and a sandwich...
--
Windows 95 n. (Win-doze): A 32 bit extension to a 16 bit user interface for
an 8 bit operating system based on a 4 bit architecture from a 2 bit company
that can't stand 1 bit of competition.
Modern day upgrade --> Windows XP Professional x64: Windows is now a 64 bit
tweak of a 32 bit extension to a 16 bit user interface for an 8 bit
operating system based on a 4 bit architecture from a 2 bit company that
can't stand 1 bit of competition.
[toc] | [prev] | [next] | [standalone]
| From | Kleuske <kleuske@nowhere.net> |
|---|---|
| Date | 2012-01-27 10:15 +0000 |
| Subject | OT:Re: About -lm switch used for linking math.h |
| Message-ID | <jfttgn$s37$2@dont-email.me> |
| In reply to | #16283 |
On Fri, 27 Jan 2012 09:48:22 +0000, Kenny McCormack saw fit to publish the
following:
> In article <1bipjxvfqk.fsf@pfeifferfamily.net>, Joe Pfeiffer
> <pfeiffer@cs.nmsu.edu> wrote: ...
>>If you're on a Unix-based system (including Linux and BSD), the man page
>>for a function will tell you both what .h file you need to #include to
>>compile it, and what library you need to use to link it. So, for
>>instance, the man page for the sin function says:
>
> This isn't necessarily true (and, in true CLC fashion, I'm going to go
> to great pains to explain why your statement isn't true in absolute
> generality). All versions of MS/PC DOS/Windows, since DOS 2.0, are
> Unix-based, yet, when I type "man {anything}" on my Windows Server 2008
> R2 Home Premium Super Deluxe (*), all I get is some dumb error message.
>
> (*) With wheels and a sandwich...
In what universe is MS-DOS "unix-based?".
--
There's a way out of any cage.
-- Captain Christopher Pike, "The Menagerie" ("The Cage"),
stardate unknown.
[toc] | [prev] | [next] | [standalone]
| From | gazelle@shell.xmission.com (Kenny McCormack) |
|---|---|
| Date | 2012-01-27 14:43 +0000 |
| Subject | Re: OT:Re: About -lm switch used for linking math.h |
| Message-ID | <jfud6p$crk$1@news.xmission.com> |
| In reply to | #16284 |
In article <jfttgn$s37$2@dont-email.me>, Kleuske <kleuske@nowhere.net> wrote:
>On Fri, 27 Jan 2012 09:48:22 +0000, Kenny McCormack saw fit to publish the
>following:
>
>> In article <1bipjxvfqk.fsf@pfeifferfamily.net>, Joe Pfeiffer
>> <pfeiffer@cs.nmsu.edu> wrote: ...
>>>If you're on a Unix-based system (including Linux and BSD), the man page
>>>for a function will tell you both what .h file you need to #include to
>>>compile it, and what library you need to use to link it. So, for
>>>instance, the man page for the sin function says:
>>
>> This isn't necessarily true (and, in true CLC fashion, I'm going to go
>> to great pains to explain why your statement isn't true in absolute
>> generality). All versions of MS/PC DOS/Windows, since DOS 2.0, are
>> Unix-based, yet, when I type "man {anything}" on my Windows Server 2008
>> R2 Home Premium Super Deluxe (*), all I get is some dumb error message.
>>
>> (*) With wheels and a sandwich...
>
>In what universe is MS-DOS "unix-based?".
This one. Re-read what I wrote. It is well understood that as of
version 2 of DOS - i.e., DOS 2.0 - DOS was based on Unix - the hierarchical
file system, the general compilation model, etc. If necessary, re-read your
history books. And, of course, all versions of DOS/Windows since then share
the legacy.
Note: Obviously, I'm playing games with the word "based" - as in
"Unix-based". The previous poster was trying to be politically correct by
avoiding saying that Linux is Unix - weaseling out by saying that Linux is
merely "Unix-based". Well, the point is that that wording allows in
DOS/Windows, which is clearly not Unix, but it is equally clearly
"Unix-based".
And that's the way of CLC...
--
But the Bush apologists hope that you won't remember all that. And they
also have a theory, which I've been hearing more and more - namely,
that President Obama, though not yet in office or even elected, caused the
2008 slump. You see, people were worried in advance about his future
policies, and that's what caused the economy to tank. Seriously.
(Paul Krugman - Addicted to Bush)
[toc] | [prev] | [next] | [standalone]
| From | tom st denis <tom@iahu.ca> |
|---|---|
| Date | 2012-01-27 07:49 -0800 |
| Subject | Re: OT:Re: About -lm switch used for linking math.h |
| Message-ID | <aaf504b9-3bbb-40a2-8bef-27d497292b61@g27g2000yqa.googlegroups.com> |
| In reply to | #16288 |
On Jan 27, 9:43 am, gaze...@shell.xmission.com (Kenny McCormack)
wrote:
> In article <jfttgn$s3...@dont-email.me>, Kleuske <kleu...@nowhere.net> wrote:
> >On Fri, 27 Jan 2012 09:48:22 +0000, Kenny McCormack saw fit to publish the
> >following:
>
> >> In article <1bipjxvfqk....@pfeifferfamily.net>, Joe Pfeiffer
> >> <pfeif...@cs.nmsu.edu> wrote: ...
> >>>If you're on a Unix-based system (including Linux and BSD), the man page
> >>>for a function will tell you both what .h file you need to #include to
> >>>compile it, and what library you need to use to link it. So, for
> >>>instance, the man page for the sin function says:
>
> >> This isn't necessarily true (and, in true CLC fashion, I'm going to go
> >> to great pains to explain why your statement isn't true in absolute
> >> generality). All versions of MS/PC DOS/Windows, since DOS 2.0, are
> >> Unix-based, yet, when I type "man {anything}" on my Windows Server 2008
> >> R2 Home Premium Super Deluxe (*), all I get is some dumb error message.
>
> >> (*) With wheels and a sandwich...
>
> >In what universe is MS-DOS "unix-based?".
>
> This one. Re-read what I wrote. It is well understood that as of
> version 2 of DOS - i.e., DOS 2.0 - DOS was based on Unix - the hierarchical
> file system, the general compilation model, etc. If necessary, re-read your
> history books. And, of course, all versions of DOS/Windows since then share
> the legacy.
Actually DOS is CP/M based ... which wasn't UNIX based.
> Note: Obviously, I'm playing games with the word "based" - as in
> "Unix-based". The previous poster was trying to be politically correct by
> avoiding saying that Linux is Unix - weaseling out by saying that Linux is
> merely "Unix-based". Well, the point is that that wording allows in
> DOS/Windows, which is clearly not Unix, but it is equally clearly
> "Unix-based".
Linux isn't UNIX based either, it's based off of MINIX which is a
variant OS that is similar to UNIX.
So not only are your posts tiresome and boring but they're wholesale
factually incorrect even when you are trying to be a smarty pants.
Tom
[toc] | [prev] | [next] | [standalone]
| From | gazelle@shell.xmission.com (Kenny McCormack) |
|---|---|
| Date | 2012-01-27 15:55 +0000 |
| Subject | Re: OT:Re: About -lm switch used for linking math.h |
| Message-ID | <jfuhd2$icj$2@news.xmission.com> |
| In reply to | #16289 |
In article <aaf504b9-3bbb-40a2-8bef-27d497292b61@g27g2000yqa.googlegroups.com>,
tom st denis <tom@iahu.ca> blubbered:
...
>So not only are your posts tiresome and boring but they're wholesale
>factually incorrect even when you are trying to be a smarty pants.
It all depends on what the meaning of the word "based" is.
--
Some of the more common characteristics of Asperger syndrome include:
* Inability to think in abstract ways (eg: puns, jokes, sarcasm, etc)
* Difficulties in empathising with others
* Problems with understanding another person's point of view
* Hampered conversational ability
* Problems with controlling feelings such as anger, depression
and anxiety
* Adherence to routines and schedules, and stress if expected routine
is disrupted
* Inability to manage appropriate social conduct
* Delayed understanding of sexual codes of conduct
* A narrow field of interests. For example a person with Asperger
syndrome may focus on learning all there is to know about
baseball statistics, politics or television shows.
* Anger and aggression when things do not happen as they want
* Sensitivity to criticism
* Eccentricity
* Behaviour varies from mildly unusual to quite aggressive
and difficult
[toc] | [prev] | [next] | [standalone]
| From | tom st denis <tom@iahu.ca> |
|---|---|
| Date | 2012-01-27 10:14 -0800 |
| Subject | Re: OT:Re: About -lm switch used for linking math.h |
| Message-ID | <7a45e92d-8aa3-43cf-82e9-3000ddc86b72@c21g2000yqi.googlegroups.com> |
| In reply to | #16290 |
On Jan 27, 10:55 am, gaze...@shell.xmission.com (Kenny McCormack) wrote: > In article <aaf504b9-3bbb-40a2-8bef-27d497292...@g27g2000yqa.googlegroups.com>, > tom st denis <t...@iahu.ca> blubbered: > ... > > >So not only are your posts tiresome and boring but they're wholesale > >factually incorrect even when you are trying to be a smarty pants. > > It all depends on what the meaning of the word "based" is. I'm "basing" it on the fact that you're a moron, and I am not.
[toc] | [prev] | [next] | [standalone]
| From | Keith Thompson <kst-u@mib.org> |
|---|---|
| Date | 2012-01-27 11:23 -0800 |
| Subject | Re: OT:Re: About -lm switch used for linking math.h |
| Message-ID | <lnliot2blm.fsf@nuthaus.mib.org> |
| In reply to | #16289 |
tom st denis <tom@iahu.ca> writes:
> On Jan 27, 9:43 am, gaze...@shell.xmission.com (Kenny McCormack)
> wrote:
[snip]
> So not only are your posts tiresome and boring but they're wholesale
> factually incorrect even when you are trying to be a smarty pants.
Please don't feed the troll.
--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
Will write code for food.
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
[toc] | [prev] | [next] | [standalone]
| From | Joe Pfeiffer <pfeiffer@cs.nmsu.edu> |
|---|---|
| Date | 2012-01-27 09:42 -0700 |
| Subject | Re: OT:Re: About -lm switch used for linking math.h |
| Message-ID | <1behulumez.fsf@pfeifferfamily.net> |
| In reply to | #16288 |
gazelle@shell.xmission.com (Kenny McCormack) writes:
> In article <jfttgn$s37$2@dont-email.me>, Kleuske <kleuske@nowhere.net> wrote:
>>On Fri, 27 Jan 2012 09:48:22 +0000, Kenny McCormack saw fit to publish the
>>following:
>>
>>> In article <1bipjxvfqk.fsf@pfeifferfamily.net>, Joe Pfeiffer
>>> <pfeiffer@cs.nmsu.edu> wrote: ...
>>>>If you're on a Unix-based system (including Linux and BSD), the man page
>>>>for a function will tell you both what .h file you need to #include to
>>>>compile it, and what library you need to use to link it. So, for
>>>>instance, the man page for the sin function says:
>>>
>>> This isn't necessarily true (and, in true CLC fashion, I'm going to go
>>> to great pains to explain why your statement isn't true in absolute
>>> generality). All versions of MS/PC DOS/Windows, since DOS 2.0, are
>>> Unix-based, yet, when I type "man {anything}" on my Windows Server 2008
>>> R2 Home Premium Super Deluxe (*), all I get is some dumb error message.
>>>
>>> (*) With wheels and a sandwich...
>>
>>In what universe is MS-DOS "unix-based?".
>
> This one. Re-read what I wrote. It is well understood that as of
> version 2 of DOS - i.e., DOS 2.0 - DOS was based on Unix - the hierarchical
> file system, the general compilation model, etc. If necessary, re-read your
> history books. And, of course, all versions of DOS/Windows since then share
> the legacy.
>
> Note: Obviously, I'm playing games with the word "based" - as in
> "Unix-based". The previous poster was trying to be politically correct by
> avoiding saying that Linux is Unix - weaseling out by saying that Linux is
> merely "Unix-based". Well, the point is that that wording allows in
> DOS/Windows, which is clearly not Unix, but it is equally clearly
> "Unix-based".
>
> And that's the way of CLC...
You're using a definition of "Unix-based" that is completely foreign to
just about everybody.
[toc] | [prev] | [next] | [standalone]
| From | 88888 Dihedral <dihedral88888@googlemail.com> |
|---|---|
| Date | 2012-01-28 14:08 -0800 |
| Subject | Re: OT:Re: About -lm switch used for linking math.h |
| Message-ID | <27955944.345.1327788530329.JavaMail.geo-discussion-forums@prhq15> |
| In reply to | #16291 |
在 2012年1月28日星期六UTC+8上午12时42分44秒,Joe Pfeiffer写道:
> gaz...@shell.xmission.com (Kenny McCormack) writes:
>
> > In article <jfttgn$s37$2...@dont-email.me>, Kleuske <kle...@nowhere.net> wrote:
> >>On Fri, 27 Jan 2012 09:48:22 +0000, Kenny McCormack saw fit to publish the
> >>following:
> >>
> >>> In article <1bipjxv...@pfeifferfamily.net>, Joe Pfeiffer
> >>>
> wrote: ...
> >>>>If you're on a Unix-based system (including Linux and BSD), the man page
> >>>>for a function will tell you both what .h file you need to #include to
> >>>>compile it, and what library you need to use to link it. So, for
> >>>>instance, the man page for the sin function says:
> >>>
> >>> This isn't necessarily true (and, in true CLC fashion, I'm going to go
> >>> to great pains to explain why your statement isn't true in absolute
> >>> generality). All versions of MS/PC DOS/Windows, since DOS 2.0, are
> >>> Unix-based, yet, when I type "man {anything}" on my Windows Server 2008
> >>> R2 Home Premium Super Deluxe (*), all I get is some dumb error message.
> >>>
> >>> (*) With wheels and a sandwich...
> >>
> >>In what universe is MS-DOS "unix-based?".
> >
> > This one. Re-read what I wrote. It is well understood that as of
> > version 2 of DOS - i.e., DOS 2.0 - DOS was based on Unix - the hierarchical
> > file system, the general compilation model, etc. If necessary, re-read your
Are you really a computer literacy at all?
DOS was based upon CPM and X86 instructions and the shell part might have some features common to the unix in looks. DOS was not unix based at all.
DOS was more DEC VMS oriented in it's shell.
> > history books. And, of course, all versions of DOS/Windows since then share
> > the legacy.
> >
> > Note: Obviously, I'm playing games with the word "based" - as in
> > "Unix-based". The previous poster was trying to be politically correct by
> > avoiding saying that Linux is Unix - weaseling out by saying that Linux is
> > merely "Unix-based". Well, the point is that that wording allows in
> > DOS/Windows, which is clearly not Unix, but it is equally clearly
> > "Unix-based".
> >
> > And that's the way of CLC...
>
> You're using a definition of "Unix-based" that is completely foreign to
> just about everybody.
Unix is C-based from AT&T and the BSD free OS in charge except service fees and tape costs in universities to avoid the expectedlaw suites. But BSD lost the case in the court of not paying AT&T taxes. It was forbidden to upgrade for new versions bfore year 2000 of the BSD OS.
Anyway the linux part is better than BSD in the 386 era proved.
If the MMU and the heap walker in linux can catch up those from DEC experts then I would say unix is not a brain damaged OS at all.
Just test the malloc in the unix, then it is so lousy that it's better to do
one's own page swapping such as Windows OS.
[toc] | [prev] | [next] | [standalone]
| From | Phil Carmody <thefatphil_demunged@yahoo.co.uk> |
|---|---|
| Date | 2012-02-14 13:14 +0200 |
| Subject | Re: OT:Re: About -lm switch used for linking math.h |
| Message-ID | <87lio5u0ov.fsf@bazspaz.fatphil.org> |
| In reply to | #16284 |
Kleuske <kleuske@nowhere.net> writes:
> On Fri, 27 Jan 2012 09:48:22 +0000, Kenny McCormack saw fit to publish the
> following:
>
> > In article <1bipjxvfqk.fsf@pfeifferfamily.net>, Joe Pfeiffer
> > <pfeiffer@cs.nmsu.edu> wrote: ...
> >>If you're on a Unix-based system (including Linux and BSD), the man page
> >>for a function will tell you both what .h file you need to #include to
> >>compile it, and what library you need to use to link it. So, for
> >>instance, the man page for the sin function says:
> >
> > This isn't necessarily true (and, in true CLC fashion, I'm going to go
> > to great pains to explain why your statement isn't true in absolute
> > generality). All versions of MS/PC DOS/Windows, since DOS 2.0, are
> > Unix-based, yet, when I type "man {anything}" on my Windows Server 2008
> > R2 Home Premium Super Deluxe (*), all I get is some dumb error message.
> >
> > (*) With wheels and a sandwich...
>
> In what universe is MS-DOS "unix-based?".
Holy moley. If his posts are going to be that hilariously stupid,
I might consider pulling him out of the killfile. Or is tha above
just a one-off, in which case thanks for responding to it so we
could all have a laugh at the pseudonymous twerp's expense?
Phil
--
Unix is simple. It just takes a genius to understand its simplicity
-- Dennis Ritchie (1941-2011), Unix Co-Creator
[toc] | [prev] | [next] | [standalone]
| From | Rui Maciel <rui.maciel@gmail.com> |
|---|---|
| Date | 2012-01-27 16:56 +0000 |
| Message-ID | <jful0l$d2v$1@speranza.aioe.org> |
| In reply to | #16283 |
Kenny McCormack wrote: > All versions of MS/PC DOS/Windows, since DOS 2.0, are > Unix-based Do you actually have any basis for that assertion? Rui Maciel
[toc] | [prev] | [next] | [standalone]
| From | gazelle@shell.xmission.com (Kenny McCormack) |
|---|---|
| Date | 2012-01-27 17:34 +0000 |
| Message-ID | <jfun6l$q19$1@news.xmission.com> |
| In reply to | #16292 |
In article <jful0l$d2v$1@speranza.aioe.org>, Rui Maciel <rui.maciel@gmail.com> wrote: >Kenny McCormack wrote: > >> All versions of MS/PC DOS/Windows, since DOS 2.0, are >> Unix-based > >Do you actually have any basis for that assertion? > > >Rui Maciel I do not mean "based" in the sense of "code based" - i.e., that they took Unix code to build DOS. Only a moronic pedant would think that - which is why we are seeing so much of it in this thread. See: "straw man". I mean "based" in the sense of "ideas borrowed from". And I mean borrowed rather heavily - not just a smidgen here and there. As I said, read your history. DOS 1 was, as Tommy notes, basically a quick hack-up of CP/M, but DOS 2 introduced a lot of Unixy stuff and made DOS quite Unix-like. And the whole point is we are all better off because of it. It made DOS (and its later progeny) much better systems. Anyway, I've made my point. I'm done. -- Windows 95 n. (Win-doze): A 32 bit extension to a 16 bit user interface for an 8 bit operating system based on a 4 bit architecture from a 2 bit company that can't stand 1 bit of competition. Modern day upgrade --> Windows XP Professional x64: Windows is now a 64 bit tweak of a 32 bit extension to a 16 bit user interface for an 8 bit operating system based on a 4 bit architecture from a 2 bit company that can't stand 1 bit of competition.
[toc] | [prev] | [next] | [standalone]
Page 1 of 5 [1] 2 3 4 5 Next page →
Back to top | Article view | comp.lang.c
csiph-web