public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Problem with math.h
@ 2001-02-15  6:43 Blinder Pablo
  2001-02-15  9:16 ` Alexandre Oliva
  0 siblings, 1 reply; 5+ messages in thread
From: Blinder Pablo @ 2001-02-15  6:43 UTC (permalink / raw)
  To: gcc-help

Dear GNU help desk:
                 While trying to compile an ANSI C source  code I
constantly get the 'Undeclared identifier' error for any math
function. The same source code compiled properly under a different
operating system (under strict ANSI).
        Both header files 'math.h' and 'bits/mathcalls.h' are present in
the include folder. What is wrong?

Thanks,

Pablo.

==================================================================
Pablo Blinder
<blinderp@bgumail.bgu.ac.il>
Shazar 25/8
Beer-Sheva (84894)
Israel
972-7-6472624 (lab)
972-7-6289235 (home)
972-54-583469 (cellular)
===================================================================


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

* Re: Problem with math.h
  2001-02-15  6:43 Problem with math.h Blinder Pablo
@ 2001-02-15  9:16 ` Alexandre Oliva
  0 siblings, 0 replies; 5+ messages in thread
From: Alexandre Oliva @ 2001-02-15  9:16 UTC (permalink / raw)
  To: Blinder Pablo; +Cc: gcc-help

On Feb 15, 2001, Blinder Pablo  <blinderp@bgumail.bgu.ac.il> wrote:

> What is wrong?

Ask Amos Bouskila :-)

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me

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

* RE: Problem with math.h
@ 2001-02-15  9:17 David Korn
  0 siblings, 0 replies; 5+ messages in thread
From: David Korn @ 2001-02-15  9:17 UTC (permalink / raw)
  To: 'Amos Bouskila', 'Blinder Pablo', gcc-help

  Hi Pablo, Amos,

[ I assume you two guys know each other since you have email addresses in
the same domain and reported the same problem within a few moments of each
other! ]

>Dear GNU help desk:

  We're not really a help desk.  We're just subscribers to the mailing list.
Some people here are members of the Gcc development teams at Cygnus and
Code Sourcery, others are just amateur hackers or end users.  Still glad
to help, if we can.

>                 While trying to compile an ANSI C source  code I
>constantly get the 'Undeclared identifier' error for any math
>function. The same source code compiled properly under a different
>operating system (under strict ANSI).
>        Both header files 'math.h' and 'bits/mathcalls.h' are 
>present in
>the include folder. What is wrong?

  Good question, and not one that can be easily answered by taking a guess
from half-way round the planet.  Good bug reports should include full
details of the system you are using (what OS and CPU), which version of the
compiler you're using (the output from gcc -v tells you), the *exact* text
of the error message in question, the *exact* command line you used to start
the compiler with, and if at all possible a few lines of cut and paste from
the code showing where the error is.

  So give this test case a try:

------mtest.c--------------
#include <math.h>

int main(void)
{
double n;

  n = sqrt(2);
  return (int)n - 1;
}
----------------------------

 Cut and paste it into a file 'mtest.c' and try building it with the 
command line

 gcc -v mtest.c -o mtest

and capture the output into a text file.  Then post all the output back to
the list.  If that doesn't tell us enough, we'll also need to try

 gcc -v mtest.c -o mtest.i -E

to have a look at the pre-processed source code.

     cheers,
        DaveK
-- 
we are not seats or eyeballs or end users or consumers.
we are human beings - and our reach exceeds your grasp.
                    deal with it.                      - cluetrain.org 


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************

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

* Re: problem with math.h
  2001-02-15  6:29 problem " Amos Bouskila
@ 2001-02-15  8:37 ` Alexandre Oliva
  0 siblings, 0 replies; 5+ messages in thread
From: Alexandre Oliva @ 2001-02-15  8:37 UTC (permalink / raw)
  To: Amos Bouskila; +Cc: gcc-help

On Feb 15, 2001, Amos Bouskila <bouskila@bgumail.bgu.ac.il> wrote:

> Surpriseingly the same error appeares whit and without  the
> #include <math.h> in the header file.

math.h contains declarations, relevant at compile time.  The
definitions are in libm, required at link time.  It can be linked in
with the `-lm' switch.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me

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

* problem with math.h
@ 2001-02-15  6:29 Amos Bouskila
  2001-02-15  8:37 ` Alexandre Oliva
  0 siblings, 1 reply; 5+ messages in thread
From: Amos Bouskila @ 2001-02-15  6:29 UTC (permalink / raw)
  To: gcc-help

Dear gcc help desk:
			While trying to compile under gcc on a  linux (both on Red hat and
Suse) machine, all ANSI math functions causes an 'Undeclared identifier'
error. Surpriseingly the same error appeares whit and without  the
#include <math.h> in the header file. The same pice of code compiled
properly under a different operating system. What is wrong?

thanks !

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

end of thread, other threads:[~2001-02-15  9:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-02-15  6:43 Problem with math.h Blinder Pablo
2001-02-15  9:16 ` Alexandre Oliva
  -- strict thread matches above, loose matches on Subject: below --
2001-02-15  9:17 David Korn
2001-02-15  6:29 problem " Amos Bouskila
2001-02-15  8:37 ` Alexandre Oliva

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).